US 11,704,305 B1
Optimizations for long-lived statements in a database system
Chen Luo, San Mateo, CA (US); Alexander Miller, San Mateo, CA (US); William Waddington, Stateline, NV (US); and Zhaohui Zhang, Redwood City, CA (US)
Assigned to Snowflake Inc., Bozeman, MT (US)
Filed by Snowflake Inc., Bozeman, MT (US)
Filed on Feb. 2, 2022, as Appl. No. 17/649,737.
Int. Cl. G06F 16/23 (2019.01); G06F 9/52 (2006.01)
CPC G06F 16/2379 (2019.01) [G06F 9/524 (2013.01); G06F 16/2365 (2019.01)] 29 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:
performing a search for a key in a regular space to locate a first visible version of the key, the regular space storing multiple versions of the key, each version of the key being a different version of the key;
determining that the first visible version of the key is not one of a N number of newest versions of the key;
after performing the search for the key in the regular space and in response to the determining, performing a search of an undo space to locate a second visible version of the key, the regular space and the undo space being different storage spaces in a cloud storage platform, the regular space storing at least an M number of different versions of the key, the M number being greater than a value of one, the M number being different than the N number of newest versions of the key, and each version of the key being prepended with a one byte prefix;
determining whether the first visible version or the second visible version of the key is newer; and
providing a newer version of the key between the first visible version and the second visible version of the key.