はじめに こんにちは!DJ.mashiです。今回はBigQueryのMaterialized View(以後、マテビュー)を利用する機会がありました。RDB(PostgreSQL)とは異なる部分も多く自分なりに情報の整理と検証を実施しました。その内容を備忘のため記載します。 RDB(PostgreSQL)のマテビューについて クエリの結果をキャッシュします。ある時点のSELECT文のスナップショットのようなイメージです。 Viewと比較して考えます。Viewは、SELECTで参照するテーブルへ更新があれば、以後そのViewへのSELECT結果も更新影響を受けます(注1)。 しかし、マテビューではある時点のSELECT文の結果がキャッシュされますので参照するテーブル更新の影響を受けません。代わりに、マテビューの内容を更新するrefleshが存在し、refleshを実行することでキャッシュの内