AWS Certified Data Engineer Associate DEA-C01 Practice Question
An Amazon Redshift RA3 cluster contains a 6 TB fact table and three small dimension tables. A data engineer runs the same SQL statement every morning to join these tables and calculate yesterday's metrics, but the query currently finishes in about 20 minutes. Distribution styles must remain unchanged, and any solution should have minimal additional cost. Which SQL-level change will most likely reduce the query runtime to under two minutes?
Rewrite the query as a UNION ALL of separate SELECT statements filtered by each dimension value.
Add compound sort keys on every column referenced in the query predicates for all joined tables.
Run the query twice each morning so the second execution uses Amazon Redshift's result cache.
Create a materialized view that pre-joins the fact and dimension tables and refresh it incrementally each day.
Materialized views store the results of a query so that subsequent executions read the pre-computed data instead of scanning and joining base tables. When the fact table receives only yesterday's incremental data, an incremental REFRESH can update the materialized view quickly, allowing the reporting query to complete in seconds. Amazon Redshift's result cache is invalidated whenever underlying tables change, so it will not help with a daily refresh. Splitting the query with UNION ALL forces multiple full scans of the fact table, increasing work. Adding many sort keys can improve some predicates but requires a full table rewrite, does not address the join cost, and may even slow down other queries-making it less effective than a materialized view in this scenario.
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 Amazon Redshift?
Open an interactive chat with Bash
How does incremental refresh work for materialized views in Redshift?
Open an interactive chat with Bash
Why is the result cache ineffective when underlying tables change in Redshift?
Open an interactive chat with Bash
AWS Certified Data Engineer Associate DEA-C01
Data Ingestion and Transformation
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 .