
Answer-first summary for fast verification
Answer: Divide the data into smaller parts based on the transaction date (Partition the data by transaction date).
The correct answer is **D. Partition the data by transaction date.** Partitioning in BigQuery organizes your data into segments based on the transaction date, allowing queries to scan only the relevant partitions. This method optimizes query performance for specific date ranges without additional storage costs. - **A. Denormalize the data:** While denormalization can reduce joins and sometimes improve performance, it may lead to higher storage costs and complicate data maintenance, making it less ideal for this scenario. - **B. Shard the data by customer ID:** Sharding distributes data across nodes for scalability but doesn't directly address performance issues for date-specific queries. - **C. Materialize the dimensional data in views:** Materialized views can speed up complex queries by storing pre-computed results, but they might not be the most efficient for queries targeting recent data and can increase storage and maintenance overhead. Partitioning by transaction date is the recommended approach to enhance query performance efficiently in BigQuery.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
Your company is moving its data warehouse to BigQuery, and you're responsible for designing the data model. After migrating an on-premises sales data warehouse with a star schema to BigQuery, you notice performance issues when querying the last 30 days of data. According to Google's best practices, what's the most effective way to improve query performance without increasing storage costs?
A
Combine tables and duplicate data to reduce joins (Denormalize the data).
B
Split the data based on customer IDs to distribute it across multiple nodes (Shard the data by customer ID).
C
Pre-compute and store the results of complex queries in views (Materialize the dimensional data in views).
D
Divide the data into smaller parts based on the transaction date (Partition the data by transaction date).
No comments yet.