Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active May 17, 2016 08:03
Show Gist options
  • Save YumaInaura/029245db965b77415c90f20e8292d568 to your computer and use it in GitHub Desktop.
Save YumaInaura/029245db965b77415c90f20e8292d568 to your computer and use it in GitHub Desktop.
BigQuery | JOIN EACH を複数使うとメチャクチャ重い問題 ref: http://qiita.com/Yinaura/items/13cc2b206921efd7172b
SELECT
*
FROM
dataset.table1 AS table1
JOIN
dataset.table2 AS table2
ON
table1.id = table2.id
JOIN
dataset.table3 AS table3
ON
table2.category = table3.category
SELECT
*
FROM
dataset.table1 AS table1
JOIN EACH
dataset.table2 AS table2
ON
table1.id = table2.id
JOIN EACH
dataset.table3 AS table3
ON
table2.category = table3.category
SELECT
*
FROM
dataset.table1 AS table1
JOIN EACH
dataset.table2 AS table2
ON
table1.id = table2.id
JOIN EACH
dataset.table3 AS table3
ON
table2.category = table3.category
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment