0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

BigQuery | JOIN EACH を複数使うとメチャクチャ重い問題

Last updated at Posted at 2016-05-17

1. JOIN の後に JOIN

普通に実行できる。

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

2. JOIN EACH の後に JOIN

むしろクエリ1より速い。

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

3.JOIN EACH の後に JOIN EACH

何分経っても結果が返ってこない。原因は不明。

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

でもお金はかかっていない様子。(たぶん)

image

補足

  • 2016/05/17 現在の情報。
  • 環境によるかもしれません。他の報告求む。

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

メンター受付

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?