What are query stages in a BigQuery execution plan, and how do you read them to understand what the engine did?

Quick Overview

Asks what the stages in a BigQuery query plan are and how to read their statistics to see where a query spent its time. Tests diagnosing data skew, slot contention, heavy shuffle, disk spill and missing partition pruning from per-stage timings and row counts.

What are query stages in a BigQuery execution plan, and how do you read them to understand what the engine did?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What are query stages in a BigQuery execution plan, and how do you read them to understand what the engine did? ```hint Many workers, many hand-offs Think about how one query is split across many parallel workers and passed from step to step. Then ask which per-step numbers would show that a single worker, or a single hand-off, is what made the query slow. ``` ### What a Strong Answer Covers - What a stage is and how stages connect into a graph through shuffle - The statistics each stage reports: rows in and out, the time breakdown, averages against maximums, shuffle and spill - A method for finding the bottleneck stage and mapping it back to the SQL that produced it - What common problems (data skew, slot contention, heavy shuffle, spill, missing partition pruning) look like in the plan and how to fix them - Where to find the plan ### Follow-up Questions - One join stage has a maximum compute time 20 times its average. What is likely happening, and how would you fix it? - Most of a stage's time is wait time. What does that tell you, and what would you change? - How would you confirm from the plan that a partition filter pruned the input? - How would you find the most expensive stages across all of last week's queries in a project?

Overview: Asks what the stages in a BigQuery query plan are and how to read their statistics to see where a query spent its time. Tests diagnosing data skew, slot contention, heavy shuffle, disk spill and missing partition pruning from per-stage timings and row counts.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

What are query stages in a BigQuery execution plan, and how do you read them to understand what the engine did?

What a Strong Answer Covers Guidance

  • What a stage is and how stages connect into a graph through shuffle
  • The statistics each stage reports: rows in and out, the time breakdown, averages against maximums, shuffle and spill
  • A method for finding the bottleneck stage and mapping it back to the SQL that produced it
  • What common problems (data skew, slot contention, heavy shuffle, spill, missing partition pruning) look like in the plan and how to fix them
  • Where to find the plan

Follow-up Questions Guidance

  • One join stage has a maximum compute time 20 times its average. What is likely happening, and how would you fix it?
  • Most of a stage's time is wait time. What does that tell you, and what would you change?
  • How would you confirm from the plan that a partition filter pruned the input?
  • How would you find the most expensive stages across all of last week's queries in a project?