Incremental refresh of a materialized view
AssigneeSnowflake lnc.
InventorsThierry Cruanes, Benoit Dageville, Prasanna Rajaperumal, Jiaqi Yan
Life of this patent
Estimating the term…
Abstract
Systems, methods, and devices for incrementally refreshing a materialized view are disclosed. A method includes generating a materialized view based on a source table. The method includes merging the source table and the materialized view to generate a merged table to identify whether an update has been executed on the source table that is not reflected in the materialized view. The method includes, in response to detecting an update made to the source table that is not reflected in the materialized view, applying the update to the materialized view.
Claims30
A system comprising:
- a compute service manager for managing internal operations of a cloud-based database platform;
- a plurality of shared storage devices collectively storing database data, wherein the plurality of shared storage devices is independent of the compute service manager;
- and
- an execution platform comprising a plurality of execution nodes, wherein the execution platform independent is independent of the plurality of shared storage devices and the compute service manager;
- wherein the compute service manager is configured to:
- generate a materialized view based on a source table, the materialized view being a database object that includes results of a persistent query, the source table including a set of micro-partitions, and the materialized view combining information in the set of micro-partitions in the source table into a single micro-partition in the materialized view;
- merge the source table and the materialized view to generate a merged table to identify whether an update has been executed on the source table that is not reflected in the materialized view, the update including a modification to one or more of micro-partitions in the set of micro-partitions in the source table;
- in response to detecting an update made to the source table that is not reflected in the materialized view, assign tasks to one or more execution nodes of the execution platform to apply the update to the materialized view, the applying of the update including updating the single micro-partition in the materialized view corresponding to the set of micro-partitions in the source table to generate an updated materialized view;
- and
- generate a response to a query using data directly from the updated materialized view without accessing the source table.
A method comprising:
- generating a materialized view based on a source table, the materialized view being a database object that includes results of a persistent query, the source table including a set of micro-partitions, and the materialized view combining information in the set of micro-partitions in the source table into a single micro-partition in the materialized view;
- merging the source table and the materialized view to generate a merged table to identify whether an update has been executed on the source table that is not reflected in the materialized view, the update including a modification to one or more of micro-partitions in the set of micro-partitions in the source table;
- and
- in response to detecting an update made to the source table that is not reflected in the materialized view, applying the update to the materialized view, including updating the single micro-partition in the materialized view corresponding to the set of micro-partitions in the source table to generate an updated materialized view;
- and
- generating a response to a query using data directly from the updated materialized view without accessing the source table.
A non-transitory machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
- generating a materialized view based on a source table, the materialized view being a database object that includes results of a persistent query, the source table including a set of micro-partitions, and the materialized view combining information in the set of micro-partitions in the source table into a single micro-partition in the materialized view;
- merging the source table and the materialized view to generate a merged table to identify whether an update has been executed on the source table that is not reflected in the materialized view, the update including a modification to one or more of micro-partitions in the set of micro-partitions in the source table;
- and
- in response to detecting an update made to the source table that is not reflected in the materialized view, applying the update to the materialized view, including updating the single micro-partition in the materialized view corresponding to the set of micro-partitions in the source table to generate an updated materialized view;
- and
- generating a response to a query using data directly from the updated materialized view without accessing the source table.
Dependencies are inferred from the claim text.