When you submit a SQL query in BigQuery, how does it physically execute end-to-end, and what factors affect its speed?

Quick Overview

Asks how BigQuery executes a SQL query from submission to result and which factors make it fast or slow. It tests understanding of the Dremel execution model, slots, columnar storage, shuffle, partition and cluster pruning, and how to read a query's execution details.

When you submit a SQL query in BigQuery, how does it physically execute end-to-end, and what factors affect its speed?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

When you submit a SQL query in BigQuery, how does it physically execute from end to end, and what factors affect its speed? ```hint Follow the bytes Think about where the table's data lives, which service does the computation, and what has to move between them at each stage of the query. ``` ```hint Use the plan Consider what the per-stage timings in a query's execution details would tell you about where the time went. ``` ### What a Strong Answer Covers - The path from submission to result: parsing and planning, the stage graph, and where each stage runs. - How storage, compute and the network between them are separated, and what that means for data movement. - The factors that change how many bytes are read and how much work each stage does. - How available capacity and the distribution of the data affect elapsed time. - How to diagnose a slow query from its execution details. ### Follow-up Questions - A query that filters on a date takes as long as a full table scan. What would you check? - One stage of a join shows a maximum compute time far above its average. What is happening, and how do you fix it? - Does adding `LIMIT 10` to a `SELECT *` query reduce the bytes scanned? Why or why not? - When would you cluster a table instead of partitioning it, and when would you do both?

Overview: Asks how BigQuery executes a SQL query from submission to result and which factors make it fast or slow. It tests understanding of the Dremel execution model, slots, columnar storage, shuffle, partition and cluster pruning, and how to read a query's execution details.

Nov 25, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

When you submit a SQL query in BigQuery, how does it physically execute from end to end, and what factors affect its speed?

What a Strong Answer Covers Guidance

  • The path from submission to result: parsing and planning, the stage graph, and where each stage runs.
  • How storage, compute and the network between them are separated, and what that means for data movement.
  • The factors that change how many bytes are read and how much work each stage does.
  • How available capacity and the distribution of the data affect elapsed time.
  • How to diagnose a slow query from its execution details.

Follow-up Questions Guidance

  • A query that filters on a date takes as long as a full table scan. What would you check?
  • One stage of a join shows a maximum compute time far above its average. What is happening, and how do you fix it?
  • Does adding LIMIT 10 to a SELECT * query reduce the bytes scanned? Why or why not?
  • When would you cluster a table instead of partitioning it, and when would you do both?