How to Control access of Materialized View ?
Following are the ways by which we can control the access of a Materialized View in Bigquery.
- At Dataset level
- At View level
- At Column level
What makes a Materialized View different from the Logical View(View) in Bigquery ?
S.No. |
Materialized View |
Logical View |
---|---|---|
1. |
It stores the data physically on the disk. |
It is a logical structure so there is no physical data storage. |
2. |
It is pre-computed. |
Hits the query on base table at run time. |
3. |
It is fast and efficient. |
It is less efficient then Materialized View. |
4. |
Syntax : CREATE OR REPLACE MATERIALIZED VIEW <PROJECT_ID>.<DATASET>.<MATERIALIZED_VIEW_NAME> AS (<QUERY_EXPRESSION>); |
Syntax : CREATE OR REPLACE VIEW <PROJECT_ID>.<DATASET>.<VIEW_NAME> AS (<QUERY_EXPRESSION>); |
What Is Materialized View In Big Query ?
A materialized view is a precomputed snapshot of data in BigQuery, which stores the data physically from the output of a query onto the disk. It automatically refreshes the data from its base table periodically, ensuring the data remains up-to-date with changes to its underlying base tables. They are faster as compared to logical views because of their significant performance.
Materialized View overcomes the need to fetch data from the base tables every time the query is executed. Instead, the precomputed data stored in the view can be quickly accessed, resulting in faster query execution and efficiency.
Base Table : A base table is a Bigquery table where the actual data resides.
Contact Us