Two large tables, sales_transaction_header and sales_transaction_line, are tightly coupled, immutable after load, and frequently joined. To optimize analytics performance, how should you model them in BigQuery?
Choose an answer
Tap an option to check your answer.
Correct answer: Create a sales_transaction table that holds the sales_transaction_header information as rows and the sales_transaction_line rows as nested and repeated fields..
Why this is the answer
The correct approach leverages BigQuery's native support for nested and repeated fields. This denormalized structure is highly optimized for analytical queries involving frequently joined, tightly coupled data like headers and lines. It reduces the need for costly JOIN operations at query time, as all relevant data for a transaction is stored together. The option to duplicate header data for each line is inefficient, leading to increased storage costs and potential data inconsistency, though it avoids joins. Storing data as a JSON data type would require parsing at query time, which is less performant than native nested fields. Maintaining separate tables and relying on WHERE clause order for performance is incorrect; BigQuery's query optimizer handles join order, and separate tables still incur join costs.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed