View vs Materialized views in BigQuery

Viewed 54

The BigQuery documentation describes each kind of view but doesn't provide particular use cases, when to use one and when to use the other, so the question here is what are some of the best use cases to use one over the other.

1 Answers

Views are generally used when data is to be accessed infrequently and data in tables get updated on a frequent basis.

Some Use Cases where you might benefit from using views are:

  • When you want to consult a table.

  • Views are commonly faster than materialized views.

  • Making use when creating a dashboard or an impression etiquette is highly recommended.

Materialized Views are used when data is to be accessed frequently and data in tables do not get updated on a frequent basis.

Some Use Cases where you might benefit from using materialized views are:

  • Pre-aggregate data. Aggregation of streaming data.
  • Pre-filter data. Run queries that only read a particular subset of the table.
  • Pre-join data. Query joins, especially between large and small tables.
  • Recluster data. Run queries that would benefit from a clustering scheme that differs from the base tables.

Note that these are just some Use Cases between views and materialized views.

Related