Ask panel reads your query and schema and proposes a change to test, it doesn't see the warehouse's execution plan unless you give it that too.
No credit card. 14 days. Cancel in one click.
Quick answer: Attach a slow query to Ask and ask what's likely causing it. It reasons from the SQL and your schema, proposes a change like reordering a join, and you test it. It doesn't auto-tune anything or see Snowflake's query profile unless you paste it in.
A query that's actually slow, ideally with a known runtime to compare against, and your own API key added under Settings โ AI Assistant.
SELECT e.event_id, u.email, e.event_type, e.created_at FROM analytics.raw_events e JOIN analytics.large_user_dim u ON e.user_id = u.user_id WHERE e.created_at >= DATEADD(day, -7, CURRENT_DATE()) AND u.region = 'EU';
Attached as Current query, a likely answer flags the join order: large_user_dim gets joined in full before the region = 'EU' filter narrows it down, so the join is working against every row in a large dimension table when filtering it first would shrink what has to be joined at all. A proposed rewrite pushes that filter into a CTE first:
WITH eu_users AS ( SELECT user_id, email FROM analytics.large_user_dim WHERE region = 'EU' ) SELECT e.event_id, u.email, e.event_type, e.created_at FROM analytics.raw_events e JOIN eu_users u ON e.user_id = u.user_id WHERE e.created_at >= DATEADD(day, -7, CURRENT_DATE());
Use Insert into editor to drop that version in as a second query tab, run both, and compare. Snowflake's optimizer sometimes reorders joins on its own, so the gain isn't guaranteed, but filtering the smaller side first before a join is a pattern worth testing whenever one side of a join is much larger than the other.
Ask reasons from the SQL and your schema unless you hand it more. Run EXPLAIN or pull the query profile from Snowflake's history and paste the output alongside your question, "here's the query and its profile, what's the actual bottleneck," and the answer moves from a plausible hypothesis about the SQL's shape to something grounded in what actually happened when it ran, spill to local storage, a partition scan, a specific operator with an outsized row count.
Ask proposes a change, it doesn't auto-tune your warehouse, add an index, or re-run your job with the new SQL in place of the old one. It also isn't reading Snowflake's actual query profile unless you paste that output into the conversation, without it, the suggestion comes from the SQL's shape and your schema, not measured execution statistics. Treat the answer as a second pair of eyes worth testing, not a guaranteed fix.
Not every slow query is a join order problem. A simpler and more frequent culprit:
SELECT * FROM analytics.raw_events WHERE CAST(created_at AS DATE) = '2026-09-01';
Wrapping created_at in CAST defeats an index or partition pruning on that column, since the warehouse can no longer tell in advance which range of the underlying data the filter applies to. Ask would likely flag the cast itself and suggest a range comparison instead: created_at >= '2026-09-01' AND created_at < '2026-09-02', which keeps the column bare so pruning can still apply.
Compare the runtime of the original and the rewritten query on the same warehouse size and roughly the same data volume. If the rewrite doesn't move the runtime, the bottleneck is probably elsewhere, warehouse size, concurrent load, or a scan that neither version avoids.
The point of asking first is to have a specific theory to test, join order, a wrapped column, a missing filter, rather than rewriting a slow query by trial and error. Some suggestions won't move the needle, and that's still useful information: it tells you the bottleneck is somewhere Ask can't see from the SQL alone, and narrows where to look next.
| If you see | Fix |
|---|---|
| Suggestion doesn't change runtime | The bottleneck may be warehouse size or concurrency, not the query's shape. Try a larger warehouse for this run as a separate test. |
| Answer restates the query without a concrete change | Attach more context: row counts for the tables involved, or an EXPLAIN/query profile, so it isn't reasoning from the SQL text alone. |
| Rewrite returns different results | Double-check the CTE or restructure didn't change the join's cardinality. Compare row counts between old and new before trusting the new runtime. |
No. It proposes SQL and an explanation; you decide whether to run it. Use Insert into editor to drop the suggestion in without losing your original, then compare.
Not unless you give it to. Attach an EXPLAIN plan or paste the query profile alongside your question for a more grounded answer; without it, Ask is reasoning from the SQL text and your schema, not the warehouse's execution plan.
That happens, especially when the real bottleneck is warehouse size or concurrent load rather than the query's shape. A suggestion is a hypothesis to test, not a guaranteed fix.
Attach Last error along with Current query and ask what's causing the timeout. It can suggest a narrower filter or a different join order, the same way it would for a merely slow query, but it can't diagnose warehouse-level resource contention on its own.
14-day free trial, no card. Ask before you rewrite by hand.
No credit card. 14 days. Cancel in one click.