US 11,755,568 B1
Execution and consistency model for materialized tables
Tyler Arthur Akidau, Seattle, WA (US); Tyler Jones, Redwood City, CA (US); Daniel Mills, Seattle, WA (US); Leon Papke, Berlin (DE); Prasanna Rajaperumal, Bangalore (IN); and Daniel E. Sotolongo, Seattle, WA (US)
Assigned to Snowflake Inc., Bozeman, MT (US)
Filed by Snowflake Inc., Bozeman, MT (US)
Filed on Sep. 13, 2022, as Appl. No. 17/931,705.
Claims priority of provisional application 63/366,196, filed on Jun. 10, 2022.
Int. Cl. G06F 16/23 (2019.01); G06F 11/34 (2006.01)
CPC G06F 16/2393 (2019.01) [G06F 11/3419 (2013.01)] 24 Claims
OG exemplary drawing
1. A system comprising:
at least one hardware processor; and
at least one memory storing instructions that cause the at least one hardware processor to perform operations comprising:
determining a dependency graph including a plurality of nodes coupled with edges, the dependency graph comprising at least a first node of the plurality of nodes with a first materialized table (MT) and a second node of the plurality of nodes with a second MT from which the first MT depends, the first node with the first MT comprising a query on one or more base tables and a lag duration value, the query defines the first MT and the lag duration value indicates a maximum time period that a result of a prior refresh of the query can lag behind a current time instance before a subsequent refresh is initiated;
selecting a tick period for a set of ticks based on the lag duration value, the set of ticks corresponding to a set of aligned time instances;
scheduling refresh operations for the first MT and the second MT at corresponding time instances from the set of aligned time instances that are within the maximum time period indicated by the lag duration, the corresponding time instances separated by the tick period; and
determining the set of aligned time instances based on a frequency level value and a refresh instance value, the frequency level value being an exponent of two, and the refresh instance value indicating a number of prior ticks that have occurred up to a current time instance.