IP Library › Granted Patent US 12,650,969
Granted Patent B2
US 12,650,969 · App. 18/759,124 · Granted Jun 9, 2026

Query processing using hybrid table secondary indexes

Inventors: Nikolaos Romanos Katsipoulakis (Redwood City, CA); Dimitrios Tsirogiannis (Belmont, CA); Zhaohui Zhang (Redwood City, CA)
Assignee: Snowflake Inc.
G06F16/2272G06F16/2264G06F16/283G06F16/284
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,650,969
App. No.
18/759,124
Filed
Jun 28, 2024
Granted
Jun 9, 2026
Kind
B2
Art Unit
2153
USPC
707/703
Abstract

The subject technology determines whether a key exists in a parent table associated with a first transaction. The subject technology performs a first write operation on a child table. The subject technology determines whether a duplicate key exists in the child table based on the key of the first write operation. The subject technology determines whether there is a conflict with the key. The subject technology, in response to determining that there is no conflict with the key, performs a second write operation on a secondary index table of the child table. The subject technology determines whether a particular duplicate key exists in the secondary index table based on a particular key from the second write operation. The subject technology, in response to determining that there is the particular duplicate key in the secondary index table, throws a uniqueness exception.

Claims (62)

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:

determining whether a key exists in a parent table associated with a first transaction;

in response to the key existing in the parent table, performing a first write operation on a child table;

determining whether a duplicate key exists in the child table based on the key of the first write operation;

in response to determining that there is no duplicate key in the child table, determining whether there is a conflict with the key;

in response to determining that there is no conflict with the key, performing a second write operation on a secondary index table of the child table;

determining whether a particular duplicate key exists in the secondary index table based on a particular key from the second write operation; and

in response to determining that there is the particular duplicate key in the secondary index table, throwing a uniqueness exception.

2 . The system of claim 1 , wherein the operations further comprise:

aborting, in response to throwing the uniqueness exception, execution of the second write operation on the secondary index table of the child table.

3 . The system of claim 1 , wherein the operations further comprise:

in response to determining that there is the conflict with the particular key, restarting a particular statement associated with the second write operation on the secondary index table of the child table.

4 . The system of claim 3 , wherein the operations further comprise:

in response to determining that there is a set of live in-flight write operations and the set of write operations committed after a read timestamp and before a write timestamp, restarting a particular statement associated with the second write operation on the secondary index table of the child table.

5 . The system of claim 1 , wherein the first transaction includes a first statement to perform a particular write operation on the parent table, and a second statement to perform the first write operation on the child table.

6 . The system of claim 1 , wherein the operations further comprise:

in response to the key not existing in the parent table, throwing a foreign key constraint exception.

7 . The system of claim 1 , wherein the operations further comprise:

in response to determining that there is the duplicate key in the child table, throwing a uniqueness exception.

8 . The system of claim 1 , wherein the operations further comprise:

in response to determining that there is the conflict with the key, restarting a particular statement associated with the first write operation on the child table.

9 . The system of claim 1 , wherein the operations further comprise:

in response to determining that there is no duplicate key in the secondary index table, determining whether there is a conflict with the particular key; and

in response to determining that there is no conflict with the particular key, performing a second read operation on the parent table of the child table to determine whether this is a set of live in-flight write operations and a set of write operations committed after a read timestamp and before a write timestamp.

10 . The system of claim 9 , wherein the operations further comprise:

in response to determining that there is not the set of live in-flight write operations nor the set of write operations committed after the read timestamp and before the write timestamp, determining whether there is a recent committed or in-flight delete operation of the parent table;

in response to determining that there is not the recent committed or in-flight delete operation of the parent table, performing a finalize operation of a particular statement associated with the first write operation on the child table; and

performing a commit operation of the first transaction.

11 . A method comprising:

determining whether a key exists in a parent table associated with a first transaction;

in response to the key existing in the parent table, performing a first write operation on a child table;

determining whether a duplicate key exists in the child table based on the key of the first write operation;

in response to determining that there is no duplicate key in the child table, determining whether there is a conflict with the key;

in response to determining that there is no conflict with the key, performing a second write operation on a secondary index table of the child table;

determining whether a particular duplicate key exists in the secondary index table based on a particular key from the second write operation; and

in response to determining that there is the particular duplicate key in the secondary index table, throwing a uniqueness exception.

12 . The method of claim 11 , further comprising:

aborting, in response to throwing the uniqueness exception, execution of the second write operation on the secondary index table of the child table.

13 . The method of claim 11 , further comprising:

in response to determining that there is the conflict with the particular key, restarting a particular statement associated with the second write operation on the secondary index table of the child table.

14 . The method of claim 13 , further comprising:

in response to determining that there is a set of live in-flight write operations and the set of write operations committed after a read timestamp and before a write timestamp, restarting a particular statement associated with the second write operation on the secondary index table of the child table.

15 . The method of claim 11 , wherein the first transaction includes a first statement to perform a particular write operation on the parent table, and a second statement to perform the first write operation on the child table.

16 . The method of claim 11 , further comprising:

in response to the key not existing in the parent table, throwing a foreign key constraint exception.

17 . The method of claim 11 , further comprising:

in response to determining that there is the duplicate key in the child table, throwing a uniqueness exception.

18 . The method of claim 11 , further comprising:

in response to determining that there is the conflict with the key, restarting a particular statement associated with the first write operation on the child table.

19 . The method of claim 11 , further comprising:

in response to determining that there is no duplicate key in the secondary index table, determining whether there is a conflict with the particular key; and

in response to determining that there is no conflict with the particular key, performing a second read operation on the parent table of the child table to determine whether this is a set of live in-flight write operations and a set of write operations committed after a read timestamp and before a write timestamp.

20 . A non-transitory computer-storage medium comprising instructions that, when executed by one or more processors of a machine, configure the machine to perform operations comprising:

determining whether a key exists in a parent table associated with a first transaction;

in response to the key existing in the parent table, performing a first write operation on a child table;

determining whether a duplicate key exists in the child table based on the key of the first write operation;

in response to determining that there is no duplicate key in the child table, determining whether there is a conflict with the key;

in response to determining that there is no conflict with the key, performing a second write operation on a secondary index table of the child table;

determining whether a particular duplicate key exists in the secondary index table based on a particular key from the second write operation; and

in response to determining that there is the particular duplicate key in the secondary index table, throwing a uniqueness exception.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 28, 2024
From: KATSIPOULAKIS, NIKOLAOS ROMANOS; TSIROGIANNIS, DIMITRIOS; ZHANG, ZHAOHUI
To: SNOWFLAKE INC.
Reel/Frame 067875/0196 →
Continuity (3)
Continuation 18171296 · Feb 17, 2023
Provisional Application 63366317 · Jun 13, 2022
Related Publication 20250005010A1 · Jan 2, 2025
References Cited (54)
US 5717924A · Kawai · 1998 [cited by examiner]
US 5991754A · Raitto · 1999 [cited by examiner]
US 6484179B1 · Roccaforte · 2002 [cited by applicant]
US 6496819B1 · Bello · 2002 [cited by examiner]
US 6728719B1 · Ganesh · 2004 [cited by examiner]
US 7617249B2 · Thusoo et al. · 2009 [cited by applicant]
US 9183254B1 · Cole et al. · 2015 [cited by applicant]
US 10216820B1 · Holenstein · 2019 [cited by examiner]
US 10318491B1 · Graham et al. · 2019 [cited by applicant]
US 11269824B1 · Waas et al. · 2022 [cited by applicant]
US 11461347B1 · Das et al. · 2022 [cited by applicant]
US 11880388B2 · Katsipoulakis et al. · 2024 [cited by applicant]
US 12405938B2 · Katsipoulakis et al. · 2025 [cited by applicant]
US 20030078923A1 · Voss · 2003 [cited by examiner]
US 20040117600A1 · Bodas et al. · 2004 [cited by applicant]
US 20060085465A1 · Nori et al. · 2006 [cited by applicant]
US 20060230016A1 · Cunningham et al. · 2006 [cited by applicant]
US 20070219999A1 · Richey et al. · 2007 [cited by applicant]
US 20100287298A1 · Leung et al. · 2010 [cited by applicant]
US 20110022819A1 · Post et al. · 2011 [cited by applicant]
US 20110082854A1 · Eidson et al. · 2011 [cited by applicant]
US 20110320403A1 · O'krafka et al. · 2011 [cited by applicant]
US 20120005154A1 · George et al. · 2012 [cited by applicant]
US 20120110515A1 · Abramoff et al. · 2012 [cited by applicant]
US 20130246698A1 · Estan et al. · 2013 [cited by applicant]
US 20140094307A1 · Doolittle et al. · 2014 [cited by applicant]
US 20140104177A1 · Ouyang et al. · 2014 [cited by applicant]
US 20140172898A1 · Aguilera et al. · 2014 [cited by applicant]
US 20140207731A1 · Mack · 2014 [cited by examiner]
US 20150019227A1 · Anandarajah · 2015 [cited by applicant]
US 20160219078A1 · Porras et al. · 2016 [cited by applicant]
US 20160239751A1 · Mosterman et al. · 2016 [cited by applicant]
US 20170052766A1 · Garipov · 2017 [cited by applicant]
US 20170316041A1 · Delaney et al. · 2017 [cited by applicant]
US 20190050437A1 · Goyal · 2019 [cited by examiner]
US 20190129893A1 · Baird, III et al. · 2019 [cited by applicant]
US 20190325055A1 · Lee et al. · 2019 [cited by applicant]
US 20200364201A1 · Cseri et al. · 2020 [cited by applicant]
US 20210311917A1 · Laskawiec · 2021 [cited by examiner]
US 20230015344A1 · Flanagan et al. · 2023 [cited by applicant]
US 20230020330A1 · Schwerin et al. · 2023 [cited by applicant]
US 20230081900A1 · Werner et al. · 2023 [cited by applicant]
US 20230401189A1 · Katsipoulakis et al. · 2023 [cited by applicant]
US 20230401236A1 · Katsipoulakis et al. · 2023 [cited by applicant]
US 20240104116A1 · Katsipoulakis et al. · 2024 [cited by applicant]
“U.S. Appl. No. 18/171,292, Non Final Office Action mailed Jul. 24, 2023”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 18/171,292, Notice of Allowance mailed Sep. 20, 2023”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 18/171,292, Response filed Aug. 31, 2023 to Non Final Office Action mailed Jul. 24, 2023”, 19 pgs. [cited by applicant]
“U.S. Appl. No. 18/171,296, Non Final Office Action mailed Jan. 18, 2024”, 7 pgs. [cited by applicant]
“U.S. Appl. No. 18/171,296, Notice of Allowance mailed Apr. 25, 2024”, 10 pgs. [cited by applicant]
“U.S. Appl. No. 18/171,296, Response filed Apr. 1, 2024 to Non Final Office Action mailed Jan. 18, 2024”, 11 pgs. [cited by applicant]
“U.S. Appl. No. 18/524,784, Non Final Office Action mailed Feb. 18, 2025”, 19 pgs. [cited by applicant]
“U.S. Appl. No. 18/524,784, Notice of Allowance mailed Jun. 24, 2025”, 13 pgs. [cited by applicant]
“U.S. Appl. No. 18/524,784, Response filed May 15, 2025 to Non Final Office Action mailed Feb. 18, 2025”, 7 pgs. [cited by applicant]