A Looker Studio dashboard relies on a BigQuery view that queries a 50-TB date-partitioned table named sales. The table is partitioned on the date column (DATE type). The view applies this filter:
WHERE DATE(order_timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
Users report that the dashboard loads slowly. The BigQuery Query Plan shows that the scan stage reads almost the entire 50-TB table. Without purchasing additional capacity or adding new Google Cloud products, what is the most effective change to remove the scan bottleneck?
Enable BigQuery BI Engine with enough in-memory capacity to cache the 50-TB table.
Rewrite the predicate to filter on the partition column directly, for example WHERE date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY).
Purchase additional dedicated slots so the full-table scan finishes faster.
Create and query a daily-refreshed materialized view that aggregates the view's results.
The table is partitioned on the date column, so BigQuery can prune partitions only when the filter is applied directly to that column. Wrapping another field (order_timestamp) in a function prevents partition pruning, forcing a full-table scan. Rewriting the predicate to reference the partitioning column lets BigQuery read just the 30 relevant partitions (roughly 60 GB if each partition is ~2 GB), dramatically lowering both I/O and slot usage. Buying slots or enabling BI Engine does not address the unnecessary scan, and creating a materialized view still requires scanning all partitions during each refresh unless the filter itself is fixed.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is partition pruning in BigQuery?
Open an interactive chat with Bash
Why does wrapping a column in a function prevent partition pruning?
Open an interactive chat with Bash
How does rewriting the predicate improve performance in this case?
Open an interactive chat with Bash
What does partition pruning mean in BigQuery?
Open an interactive chat with Bash
Why does using a function like DATE(order_timestamp) prevent partition pruning?
Open an interactive chat with Bash
How does table partitioning improve BigQuery query performance?
Open an interactive chat with Bash
GCP Professional Data Engineer
Preparing and using data for analysis
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .