What is clustering in BigQuery, and how does it differ from partitioning?

Quick Overview

Asks what clustering is in BigQuery and how it compares with table partitioning. Tests knowledge of how BigQuery prunes data, how column order and cardinality affect each option, how cost estimates differ, and when to combine the two in a table design.

What is clustering in BigQuery, and how does it differ from partitioning?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What is clustering in BigQuery, and how does it differ from partitioning? ```hint What gets skipped For each feature, ask which unit of storage BigQuery can skip when a query filters, and at what point BigQuery knows how much data it skipped. ``` ### What a Strong Answer Covers - What clustering does to the physical layout and how block metadata lets BigQuery skip data - Why the order of the clustering columns matters - How it differs from partitioning in granularity, number of columns, cardinality and cost estimates - The table-management features partitions have and clustering does not - When to use each one, and how to combine them ### Follow-up Questions - A table is clustered by `country, user_id`. Why does a query that filters only on `user_id` usually read more data than one that filters on `country`? - The dry run estimates 2 TB for a query on a clustered table, but the job bills 150 GB. What explains the gap? - When would you cluster a table without partitioning it? - How would you choose between ingestion-time partitioning and partitioning on an event timestamp column?

Overview: Asks what clustering is in BigQuery and how it compares with table partitioning. Tests knowledge of how BigQuery prunes data, how column order and cardinality affect each option, how cost estimates differ, and when to combine the two in a table design.

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

What is clustering in BigQuery, and how does it differ from partitioning?

What a Strong Answer Covers Guidance

  • What clustering does to the physical layout and how block metadata lets BigQuery skip data
  • Why the order of the clustering columns matters
  • How it differs from partitioning in granularity, number of columns, cardinality and cost estimates
  • The table-management features partitions have and clustering does not
  • When to use each one, and how to combine them

Follow-up Questions Guidance

  • A table is clustered by country, user_id . Why does a query that filters only on user_id usually read more data than one that filters on country ?
  • The dry run estimates 2 TB for a query on a clustered table, but the job bills 150 GB. What explains the gap?
  • When would you cluster a table without partitioning it?
  • How would you choose between ingestion-time partitioning and partitioning on an event timestamp column?