US 12,189,616 B2
Query execution using 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 Jul. 17, 2023, as Appl. No. 18/353,317.
Application 18/353,317 is a continuation of application No. 17/931,705, filed on Sep. 13, 2022, granted, now 11,755,568.
Claims priority of provisional application 63/366,196, filed on Jun. 10, 2022.
Prior Publication US 2023/0401199 A1, Dec. 14, 2023
Int. Cl. G06F 16/23 (2019.01); G06F 11/34 (2006.01)
CPC G06F 16/2393 (2019.01) [G06F 11/3419 (2013.01)] 30 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:
retrieving a plurality of materialized tables (MTs), each MT of the plurality of MTs including a lag duration and referring to a corresponding base table of a plurality of base tables, the lag duration indicating a maximum time period that a result of a prior refresh of a query on the corresponding base table can lag behind a current time instance;
determining a plurality of time instances for the MT based on the lag duration and a number of prior refreshes of the corresponding base table;
determining a plurality of aligned time instances for the plurality of MTs based on the plurality of time instances for each MT of the plurality of MTs and further based on a refresh instance value indicating a number of prior aligned time instances that have occurred up to a current time instance; and
scheduling refresh operations for the plurality of MTs at one or more of the plurality of aligned time instances that are within the maximum time period indicated by the lag duration associated with each of the plurality MTs.