Docs
Docs /SQL Editor /Execution plan
SQL EditorPrism Insights

Execution plan

Stage by stage, what BigQuery did with a query that has run. Row counts in and out, slot time, shuffle volume, and the performance problems Querylab.io recognized in the plan. Open it when a query was slower or costlier than the estimate said it would be.

Prism Insights → Execution Plan
PRISM INSIGHTS×
Execution Plan
Duration718ms
Processed648.1 MB
Cost$0.00
Stages5
✓ No performance issues detected
Your query executed efficiently!
Execution Stages (5)
Data Flow
fact_mot_test
12.4M rows
↓ Partition filter + GROUP BY (5 partitions) -98.2%
S00: Input
READ AGGREGATE COMPUTE FILTER WRITE
224.6K rows
↓ Grouping rows -88.8%
S01: Aggregate+
READ AGGREGATE COMPUTE WRITE
25.0K rows
A five-stage GROUP BY over fact_mot_test. The first stage reads 12.4M rows and writes 224.6K: partition pruning plus the aggregation removed 98.2% of the data before anything was shuffled.

Opening it

The plan comes from the finished job, so the query has to have run first. Then:

  • In the editor’s status bar, the bytes-and-time text after the cost (0.15 s elapsed, 648.1 MB) gets a dotted underline. Click it.
  • If the Prism Insights panel is already open, its Execution Plan view updates by itself when the job finishes.
  • While a query is still running, the status text is also clickable and shows the stages completed so far.

For a multi-statement script the plan belongs to the statement selected in the results bar; pick another statement and the plan follows. In a notebook, each cell’s status has its own View execution plan.

Reading the plan

The view is ordered so the useful part is at the top.

Summary numbers

Duration, Processed (bytes billed), Cost at the tab’s pricing, Stages, and Cache when the result came from BigQuery’s cache. When the job reports BI Engine statistics, BI Engine Accelerated (with the mode) or BI Engine Not Used (with BigQuery’s reasons) appears here as well.

Performance issues

Querylab.io reads the stage statistics and reports patterns it recognizes. With nothing found, the green card says so. Otherwise each issue has a severity, its impact, the stages involved, and a list of fixes; Optimize with Prism AI hands the plan and the query to the agent with the issues already in context.

IssueWhat the plan showed
Partition Pruning FailedA partitioned table was scanned in full; the filter on the partition column didn’t prune
Late Filtering DetectedFilters were applied in a later stage, after bytes had already been processed and shuffled
Join Explosion DetectedA join stage wrote many times more rows than it read
Data Skew DetectedOne worker did a disproportionate share of a stage’s work
Sequential Aggregation BottleneckAn aggregation couldn’t be parallelized and took a large share of the total time
Shuffle Spill to DiskShuffle data exceeded memory and spilled to disk
Slot Starvation DetectedThe query waited for slots
Insufficient Shuffle QuotaThe shuffle quota, not compute, was the limit
Query Performance RegressionThis run took several times longer than the average of its previous runs
BI Engine Not UsedBI Engine acceleration was available but not used

Execution stages

Collapsed by default. It opens with the Data Flow chart: the source tables with their row counts, then each stage’s operations and the rows it wrote, with the percentage change between stages and its reason: Partition filter, GROUP BY, Filtering, Joining tables. A stage that multiplies rows is marked with the factor.

Below the chart, one card per stage:

FieldMeaning
S00: Input + statusBigQuery’s stage name; COMPLETE, RUNNING, or PENDING. The slowest stage carries a BOTTLENECK tag
OperationsREAD, FILTER, AGGREGATE, JOIN, COMPUTE, SORT, WRITE, …
DurationWall time and its share of the query, e.g. 341ms (47.5%)
Slot-msSlot time consumed; this is what a reservation pays for
Records Read / WrittenRows in and out of the stage
ShuffleBytes moved between workers
StepsBigQuery’s own step list: the table and columns read, the filter it applied, the grouping keys

⌘-click (Ctrl-click on Windows and Linux) a stage card to select the SQL it came from in the editor. A stage whose steps don’t map back to your text (an internal repartition, say) doesn’t react.

When a query has parallel branches (a join reading two tables, a UNION ALL), the stages are drawn as a graph above the cards, left to right by dependency, with the critical path in orange and the bottleneck stage flagged. Straight-line queries skip the graph.