Your retail analytics team ingests 5 TB of point-of-sale records into a single BigQuery table every day. Analysts typically run interactive SQL that filters on sale_date BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 90 DAY) AND CURRENT_DATE() and aggregates by store_id and product_category. Queries are becoming slower and more expensive, but the upstream ingestion pipeline cannot be modified. Which BigQuery design change will most effectively reduce both query latency and bytes scanned costs?
Create a materialized view that pre-aggregates sales for the last 90 days and refresh it on demand.
Convert the table to a partitioned table on sale_date and add clustering columns for store_id and product_category.
Replace the single table with daily sharded tables named sales_YYYYMMDD and query them with table wildcards.
Normalize the schema by moving store and product attributes into separate dimension tables and leaving only foreign keys in the fact table.
Partitioning the table by sale_date ensures that only the partitions covering the last 90 days are read, eliminating scans of older data. Adding clustering on store_id and product_category further narrows the set of blocks that must be scanned during aggregation, improving performance without additional storage or maintenance overhead. Daily sharded tables still read every shard that matches the wildcard, normalized schemas introduce extra joins without reducing bytes scanned, and materialized views would require continuous maintenance and may not cover every ad-hoc grouping analysts perform.
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 table partitioning in BigQuery?
Open an interactive chat with Bash
What are clustering columns in BigQuery?
Open an interactive chat with Bash
How does partitioning and clustering reduce query costs in BigQuery?
Open an interactive chat with Bash
What is a partitioned table in BigQuery?
Open an interactive chat with Bash
How does clustering work in BigQuery tables?
Open an interactive chat with Bash
Why is using daily sharded tables with wildcards less efficient than partitioning in BigQuery?
Open an interactive chat with Bash
GCP Professional Data Engineer
Storing the data
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 .