DBS-C01 Workload-Specific Database Design Practice Question
An e-commerce platform uses Amazon RDS for PostgreSQL to store order data. The database has a table "orders" with 500 million rows. The application runs a report query that aggregates daily sales for the last 30 days. The query currently scans the entire table and takes 15 minutes to complete. The team needs to reduce the query time to under 30 seconds. Which solution is MOST cost-effective?
⚠ Common exam trap
Watch out — candidates often choose partitioning (Option A) thinking it will reduce scan time, but they overlook that partitioning does not precompute aggregates and still requires scanning multiple partitions, whereas a materialized view directly addresses the aggregation bottleneck at a lower cost.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create a materialized view that stores daily sales aggregates and refresh it nightly.
A materialized view precomputes and stores the daily sales aggregates, allowing the application to query the precomputed result set directly instead of scanning 500 million rows. Refreshing the materialized view nightly (e.g., using pg_cron or a scheduled lambda) ensures the data is fresh enough for the report while keeping query time under 30 seconds. This approach avoids the cost of larger instances or complex partitioning and is the most cost-effective solution for a read-heavy, periodic aggregation workload.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Partition the table by month and query only the relevant partitions.
Why it's wrong here
Partition pruning helps but still requires scanning 30 days of data (one partition). Aggregation over that partition can be slow.
- ✓
Create a materialized view that stores daily sales aggregates and refresh it nightly.
Why this is correct
The report reads pre-computed aggregates, reducing query time drastically.
- ✗
Add a composite index on the date column and the sales amount column.
Why it's wrong here
An index could help range scans but the query still needs to aggregate many rows, possibly still slow.
- ✗
Upgrade the RDS instance to a larger size with more vCPUs and memory.
Why it's wrong here
Scaling up is expensive and may not reduce query time to under 30 seconds due to full table scan.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DBS-C01 question is part of Courseiva's 1,663-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.