Model a BigQuery table of store transactions (transaction time, items, store ID, city, state) queried frequently for item counts over the past 30 days and trends by state/city/store. How should you partition and cluster for best performance?
Choose an answer
Tap an option to check your answer.
Correct answer: Partition by transaction time; cluster by state, then city, then store ID..
Why this is the answer
Partitioning by transaction time is crucial because queries frequently filter by time (e.g., "past 30 days"). This significantly reduces the amount of data BigQuery needs to scan. Clustering by state, then city, then store ID is optimal because the queries also analyze trends by these geographical and organizational dimensions. Clustering sorts data within partitions, ensuring that rows with similar state, city, and store ID values are stored together. This co-location speeds up queries that group or filter by these columns, as BigQuery can efficiently read contiguous blocks of relevant data, minimizing I/O and improving performance. The order of clustering columns should reflect the typical query granularity, moving from broader (state) to narrower (store ID) for effective pruning.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed