A 5-TB BigQuery table stores raw sales transactions. A Looker Studio dashboard refreshes every hour by running an unchanged SQL query that calculates total revenue per product category for the last seven days. Each refresh now scans the full table, costs several dollars, and takes about 15 seconds. You need to bring query latency under two seconds and cut per-refresh cost, while requiring little or no modification to the existing dashboard query. Which solution best meets these goals?
Partition the sales table by date and cluster it on product category, then instruct report authors to include the date filter so only the last seven days are scanned.
Purchase a 20 GB BigQuery BI Engine reservation so the dashboard queries are cached in memory without adjusting the underlying data model.
Nightly export the most recent seven days of transactions to Cloud Bigtable, create an external table on top of it, and repoint the dashboard to query Bigtable instead of BigQuery.
Create a materialized view that pre-aggregates last-seven-day revenue by product category and rely on BigQuery's automatic query rewrite so the dashboard continues to run its existing SQL against the cached results.
A BigQuery materialized view can store a pre-aggregated result set (for example, revenue summed per product category for the rolling seven-day window). Because the materialized view is incrementally refreshed, each dashboard run touches only the small, cached result instead of the 5 TB base table, typically reducing both latency and the number of bytes billed. When a user query is semantically compatible, BigQuery's optimizer automatically rewrites it to read from the materialized view, so the existing dashboard SQL does not need to change. Simply partitioning and clustering the base table lowers scanned bytes but still requires processing raw records and forces SQL changes. Reserving BI Engine memory may speed execution but does not eliminate full-table scan costs and might exceed the memory budget. Exporting data to Cloud Bigtable adds complexity, requires query rewrites, and provides no built-in aggregation benefits for SQL dashboards.
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 a BigQuery materialized view?
Open an interactive chat with Bash
How does automatic query rewrite work in BigQuery?
Open an interactive chat with Bash
What is the role of table partitioning and clustering in BigQuery?
Open an interactive chat with Bash
What is a materialized view in BigQuery?
Open an interactive chat with Bash
How does BigQuery’s automatic query rewrite for materialized views work?
Open an interactive chat with Bash
Why is partitioning and clustering not the optimal solution for this scenario?
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 $11.99
$11.99/mo
Billed monthly, Cancel any time.
$19.99 after promotion ends
3 Month Pass
$44.99 $26.99
$8.99/mo
One time purchase of $26.99, Does not auto-renew.
$44.99 after promotion ends
Save $18!
MOST POPULAR
Annual Pass
$119.99 $71.99
$5.99/mo
One time purchase of $71.99, Does not auto-renew.
$119.99 after promotion ends
Save $48!
BEST DEAL
Lifetime Pass
$189.99 $113.99
One time purchase, Good for life.
Save $76!
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .