US 12,314,267 B2
Automated tracking of oldest running statement in distributed MVCC databases
Cristian Diaconu, Kirkland, WA (US); Chen Luo, San Mateo, CA (US); and Alexander Miller, San Mateo, CA (US)
Assigned to Snowflake Inc., Bozeman, MT (US)
Filed by Snowflake Inc., Bozeman, MT (US)
Filed on May 26, 2023, as Appl. No. 18/324,669.
Prior Publication US 2024/0394263 A1, Nov. 28, 2024
Int. Cl. G06F 16/2457 (2019.01); G06F 16/215 (2019.01); G06F 16/22 (2019.01)
CPC G06F 16/24573 (2019.01) [G06F 16/215 (2019.01); G06F 16/2282 (2019.01)] 24 Claims
OG exemplary drawing
 
1. A system comprising:
at least one hardware processor; and
a memory storing instructions that cause the at least one hardware processor to perform operations comprising:
initializing a statement for execution;
determining that the statement has been executing for longer than a minimum statement timeout, the determining comprising determining that the statement has not yet completed execution for a period of time greater than the minimum statement timeout;
in response to determining that the statement has not yet completed execution for a period of time greater than the minimum statement timeout, periodically updating a read timestamp table with a new update timestamp for an entry corresponding to the statement, the periodically updating comprising:
after determining that the statement has not yet completed execution, determining that a first particular period of time has elapsed since the initializing the statement for execution;
determining a first current time; and
updating an update timestamp of the entry with the first current time;
determining whether the entry corresponding to the statement has been removed from the read timestamp table;
in response to determining that the entry has not been removed from the read timestamp table, removing the entry from the read timestamp table; and
providing a set of results from completing execution of the statement.