QuestionQ15

Storing the data

You are designing a data model in BigQuery to store retail transaction data. Your two largest tables, sales_transaction_header and sales_transaction_line, have a tightly coupled, immutable relationship. These tables are seldom changed after loading and are often joined in queries. You need to model the sales_transaction_header and sales_transaction_line tables to enhance the performance of data analytics queries. What should you do?

Explanation

BigQuery recommends denormalizing hierarchical parent-child data that is frequently queried together by storing the parent as one row and the child records as nested, repeated fields. This preserves the one-to-many transaction-header-to-line relationship while avoiding the communication and shuffle overhead of frequent joins.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!