joingoogle-bigquerydenormalization

Joining 3 larges tables into 1 table with 1 to many relationship in Google BigQuery


I have only started working with BigQuery recently and would like to join 3 tables with 1:many relationship (10M (fact), 20M and 36M rows respectively) into one single table to use in Tableau. Is there any advice or guidance on how to go about this without hitting performance issues or any other consideration?

Thank you in advance for the help


Solution

  • Using the JOINS in your situation is the right way to go. From what it looks like (without knowing your tables structure), you should start from:

       select 
         ct.some_thing as c_field, 
         bt.some_thing as b_field, 
         a.some_thing as a_field 
       from C ct 
       left join B bt on ct.some_field = bt.some_field 
       left join A at on bt.some_field = at.some_field