QuestionQ52

Storing the data

You collect IoT sensor data from millions of devices worldwide and store it in BigQuery. Your access pattern uses recent data filtered by location_id and device_version, using the following query:

Question Image

You want to optimize query cost and performance. How should you organize your data?

Explanation

Partitioning by create_date lets BigQuery prune all partitions outside the most recent seven days. Clustering the remaining data by location_id and device_version lets BigQuery skip irrelevant storage blocks for those equality filters. BigQuery native tables support one partitioning column, while partitioning and clustering can be combined for finer-grained pruning.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!