A simple BigQuery query SELECT country, state, city FROM mytable GROUP BY country is always slow. Query plan shows heavy read in Stage:1. What is the most likely cause?
Choose an answer
Tap an option to check your answer.
Correct answer: Most rows have the same country value, causing data skew.
Why this is the answer
Data skew, where a disproportionate number of rows share the same value for a GROUP BY key (here, country), is the most likely cause of slow performance and heavy reads in Stage 1. BigQuery processes data in parallel, but if one key has significantly more data, the worker assigned to that key becomes a bottleneck, leading to a "hot spot" and reduced parallelism. Stage 1 typically involves reading and shuffling data, so a heavy read here indicates an issue with data distribution before aggregation. Too many concurrent queries might slow down overall performance but wouldn't specifically cause heavy reads in Stage 1 for a single query. Too many partitions can sometimes lead to overhead, but it's less likely to manifest as heavy reads in Stage 1 for a simple GROUP BY unless the partitioning scheme itself is causing skew. NULLs in state or city are irrelevant since these columns are not part of the GROUP BY clause.
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