Your media company streams millions of click records every minute into an append-only BigQuery table named events_raw that is partitioned by event_date. A Looker Studio dashboard refreshes every minute with a query that aggregates the previous day's clicks by country and referrer. The repeated execution of this aggregation has driven up slot usage and query cost. You must lower cost and latency while leaving both the analysts' SQL and the dashboard configuration unchanged. What should you do?
Enable the "Use cached results" option in Looker Studio so identical queries are served from BigQuery's query cache rather than re-executed each minute.
Convert events_raw to a clustered table on country and referrer and purchase a BI Engine reservation to keep frequently accessed data in memory.
Schedule a daily batch job that writes yesterday's aggregation to a new partitioned table and update all Looker Studio reports to query that table instead of events_raw.
Create a materialized view that pre-aggregates yesterday's clicks by country and referrer and keep the dashboard pointing to events_raw so the BigQuery optimizer can automatically rewrite the queries to use the cached results.
A materialized view can store the pre-aggregated results in columnar storage and is automatically refreshed as new rows arrive in the underlying table. When a user runs a query that is semantically equivalent to the definition of the materialized view, BigQuery's optimizer transparently rewrites the query so that it reads from the materialized view instead of scanning events_raw. This eliminates repeated full scans, cuts slot consumption, and requires no changes to analysts' queries or to the dashboard. The other options either require changing the dashboard queries, still force full scans of raw data, or rely on the query cache, which is invalidated whenever the streaming table is updated, making them ineffective for this workload.
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 materialized view in BigQuery?
Open an interactive chat with Bash
How does BigQuery's optimizer rewrite queries for materialized views?
Open an interactive chat with Bash
What are the benefits of partitioning and clustering in BigQuery tables?
Open an interactive chat with Bash
What is a materialized view in BigQuery?
Open an interactive chat with Bash
How does BigQuery's optimizer rewrite queries using materialized views?
Open an interactive chat with Bash
Why is a materialized view better for handling streaming data compared to query cache?
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 .