Query analysis shows how a query does its work: an execution analysis of one real run, and what-if estimates for hypothetical indexes on the tables a chart reads. Both appear on the cost card that Model AI returns for a chart's query, and a Model Builder runs the same checks while it tunes a model. Query cost covers the card and its four modes; this page goes through the analysis and what-if results themselves.
Ask the Model AI chat for an analysis of the query behind a chart. While it works, the chat shows Analyzing one run of a query. The run executes the chart's query once, with the result cache off, and reads the plan the database produced. Its timing is one run, not a median, and the card carries the note "EXPLAIN ANALYZE ran the chart once with the result cache off; its timing is one run, not the median of a measure."
estimated no stats where the estimate belongs, and q-error not collected.Show EXPLAIN ANALYZE opens the card's copy of the plan. When the text is cut, the card says "Only the first part of the plan text is shown."
Query summary: block: the total time with its split into planning and execution, the rows and bytes read, and peak memory. When the server reports it, a further line splits the time into three parts: in steps, outside steps, and idle.Stage (build) and Stage (probe) carry their own times and shares, and the runtime filters that ran are named on the step they helped.Ask the chat to price indexes you are considering on the tables a chart reads; while it works, the chat shows Estimating candidate indexes. The candidates are hypothetical: nothing is built, and they live only for the estimate.
Open the Model AI chat beside a semantic model and ask in your own words: for an analysis of the query behind a chart, or for a price on an index you are considering on the tables the chart reads. The chat shows Analyzing one run of a query or Estimating candidate indexes while it works.
It measures how far the planner's estimate was from what actually came out, on a join's output. q-error 1.00 means the estimate was exact; the higher it goes, the further off the estimate was, and a misestimated join becomes a finding when it drifts far enough.
The database does not count matched rows for ANY and ASOF joins, and the joins charts build are LEFT ANY. For those, Matched, match rate and fan-out read not collected; the rest of the join facts still work.
Rows in → out is what entered the step and what left it, with the share the step filtered away. Slowest stage gives the time and share of the step's slowest stage, so you can see where the step's time went.
It keeps the most expensive steps so the table stays readable, and a line under it counts the rest as faster steps not shown.
They say how the saving was obtained: measured when the database measured the kept data, measured on a sample when only part of the kept data was read, estimated for a statistical figure, and applicability only when the check answered only whether the index applies.
The index could not be priced on that table, and the reason follows the label, for example that the chart has no filter on the table that an index could use. A whole table can also end Not applicable, Timed out, Failed or Skipped.
A table with a replacing column or an upsert load is read with FINAL, and how a skip index prunes under FINAL cannot be modelled accurately, so an estimate would be a guess. A real index still prunes there, so choose it from the plan and measure the chart after it is written; Skip indexes and Refreshing views walks through writing one.
No. Query analysis does not run on the SQL you type in a console; it runs on a chart's query through the Model AI chat, as described above. While you write SQL, the Editor's own help is its syntax check and formatter: see Write and check SQL.