Question 750 of 890
hardMultiple ChoiceObjective-mapped
Improve BigQuery Query Performance with Reclustering
A company stores IoT sensor readings in BigQuery. The table is partitioned by day and clustered by sensor_id. Query performance has degraded as data grows; many queries filter by a date range and a single sensor_id. Which optimization should be applied first?
Quick Answer
The answer is to recluster the table to ensure data is sorted by sensor_id within each partition. This is correct because BigQuery’s clustering metadata tracks the min and max values of the clustering column within each block; when queries filter by a date range and a single sensor_id, reclustering physically sorts the rows so that blocks containing that sensor_id are tightly grouped, allowing BigQuery to prune irrelevant blocks and drastically reduce the amount of data scanned. On the Google Professional Data Engineer exam, this scenario tests your understanding that partitioning alone isn’t enough when data grows—clustering must be actively maintained, as automatic reclustering can lag behind heavy ingestion. A common trap is to assume that simply adding a partition or cluster is permanent, but the exam expects you to know that reclustering is an ongoing optimization for query performance. Memory tip: think of it as “re-shelving books by author after they’ve been tossed back in randomly”—reclustering restores the sorted order that pruning relies on.
⚠ Common exam trap
Google Cloud often tests the misconception that adding more compute resources (slots) or redundant WHERE clauses will fix performance issues caused by poor data layout, when the correct first step is to optimize data organization through clustering and partitioning.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Recluster the table to ensure data is sorted by sensor_id within each partition.
Reclustering the table ensures that within each daily partition, the data is physically sorted by sensor_id. This optimizes the performance of queries that filter by a date range and a single sensor_id, as BigQuery can use the clustering metadata to prune blocks and read only the relevant data, reducing the amount of data scanned and improving query speed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Remove clustering on sensor_id as it may cause overhead.
Why it's wrong here
Clustering is beneficial for queries filtering on that column.
- ✗
Add a WHERE clause to filter by partition date even if the query already filters by a date range.
Why it's wrong here
Partition pruning is automatic based on date range.
- ✗
Increase the number of BigQuery slots assigned to the project.
Why it's wrong here
More slots increase throughput but don't fix inefficient scans.
- ✓
Recluster the table to ensure data is sorted by sensor_id within each partition.
Why this is correct
Clustering improves filter performance by reducing scanned data.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
2 more ways this is tested on PDE
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company stores IoT sensor data in BigQuery. Queries that filter on a timestamp column and a device_id column are slow even though the table is partitioned by day. What should the data engineer do to improve query performance?
medium- A.Increase the partition size to monthly
- B.Switch to ingestion-time partitioning instead of column-based
- C.Enable automatic query rewriting with BI Engine
- ✓ D.Cluster the table on device_id
Why D: Clustering on device_id organizes the data within each day partition by device_id, allowing BigQuery to prune blocks during queries that filter on that column. This reduces the amount of data scanned and improves query performance without changing the partitioning scheme. Partitioning alone only limits scans by time range; clustering adds intra-partition sorting for non-time-based filters.
Variation 2. A company uses BigQuery to run reporting queries on a table that is partitioned by date and clustered by customer_id. Queries filtering by customer_id and a date range are performing poorly. What is the most likely cause?
medium- A.The project lacks sufficient BigQuery slot capacity
- B.The table is too large for BigQuery
- C.Clustering column order should be date first, then customer_id
- ✓ D.The date range filter is too wide, causing scans of many partitions
Why D: When a table is partitioned by date and clustered by customer_id, queries that filter on both columns can still perform poorly if the date range filter is too wide, causing BigQuery to scan many partitions. Even with clustering, scanning a large number of partitions negates the benefit of clustering, as clustering only reduces the data scanned within each partition. The query optimizer must read all partitions that fall within the date range, and if that range is broad, the scan overhead dominates.
Last reviewed: Jun 30, 2026
This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.