IP Library › Granted Patent US 10,997,179
Granted Patent B1
US 10,997,179 · App. 17/086,228 · Granted May 4, 2021

Pruning index for optimization of pattern matching queries

Inventors: Thierry Cruanes (San Mateo, CA); Benoit Dageville (San Mateo, CA); Ismail Oukid (Berlin, DE); Stefan Richter (Berlin, DE)
Assignee: Snowflake Inc.
G06F16/24557G06F16/2272G06F16/283G06F16/9035G06F17/18
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 10,997,179
App. No.
17/086,228
Granted
May 4, 2021
Kind
B1
Abstract

A query directed at a source table organized into a set of batch units is received. The query includes a pattern matching predicate that specifies a search pattern. A set of N-grams are generated based on the search pattern. A pruning index associated with the source table is accessed. The pruning index comprises a set of filters that index distinct N-grams in each column of the source table. The pruning index is used to identify a subset of batch units to scan for matching data based on the set of N-grams generated for the search pattern. The query is processed by scanning the subset of batch units.

Claims (63)

1. A database 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:

receiving a query directed at a source table organized into a set of batch units, the query including a pattern matching predicate specifying a search pattern;

generating a set of N-grams based on the search pattern;

accessing a pruning index associated with the source table, the pruning index comprising a set of filters that index distinct N-grams in each column of the source table;

identifying, using the set of N-grams generated based on the search pattern, a subset of batch units to scan for matching data based on the pruning index associated with the source table; and

processing the query by scanning the subset of batch units.

2. The database system of claim 1 , wherein:

the operations further comprise preprocessing the search pattern before generating the set of N-grams, and

the preprocessing of the search pattern includes generating one or more preprocessed variants of the search pattern.

3. The database system of claim 2 , wherein the preprocessing of the search pattern includes generating a case-agnostic variant of the search pattern.

4. The database system of claim 2 , wherein the preprocessing of the search pattern includes generating one or more misspelled variants of the search pattern.

5. The database system of claim 2 , wherein the preprocessing of the search pattern includes generating one or more synonymous variants corresponding to synonyms of the search pattern.

6. The database system of claim 2 , wherein the preprocessing of the search pattern includes generating a variant with one or more special characters to mark a start and end of the search pattern.

7. The database system of claim 1 , wherein identifying the subset of batch units comprises:

generating a set of fingerprints based on the set of N-grams; and

comparing the set of fingerprints to the pruning index.

8. The database system of claim 7 , wherein generating the set of fingerprints based on the set of N-grams comprises computing a hash for each N-gram in the set of N-grams.

9. The database system of claim 7 , wherein identifying the subset of batch units further comprises:

identifying one or more values in the pruning index that match one or more fingerprints in the set of fingerprints; and

identifying the subset of batch units based on the one or more values.

10. The database system of claim 1 , wherein the pruning index comprises a set of filters, each filter in the set of filters corresponding to one batch unit in the set of batch units.

11. A method comprising:

receiving a query directed at a source table organized into a set of batch units, the query including a pattern matching predicate specifying a search pattern;

generating a set of N-grams based on the search pattern;

accessing a pruning index associated with the source table, the pruning index comprising a set of filters that index distinct N-grams in each column of the source table;

identifying, using the set of N-grams generated based on the search pattern, a subset of batch units to scan for matching data based on the pruning index associated with the source table; and

processing the query by scanning the subset of batch units.

12. The method of claim 11 , further comprising preprocessing the search pattern before generating the set of N-grams, wherein the preprocessing of the search pattern includes generating one or more preprocessed variants of the search pattern.

13. The method of claim 12 , wherein the preprocessing of the search pattern includes generating a case-agnostic variant of the search pattern.

14. The method of claim 12 , wherein the preprocessing of the search pattern includes generating one or more misspelled variants of the search pattern.

15. The method of claim 12 , wherein the preprocessing of the search pattern includes generating one or more synonymous variants corresponding to synonyms of the search pattern.

16. The method of claim 12 , wherein the preprocessing of the search pattern includes generating a variant with one or more special characters to mark a start and end of the search pattern.

17. The method of claim 11 , wherein identifying the subset of batch units comprises:

generating a set of fingerprints based on the set of N-grams; and

comparing the set of fingerprints to the pruning index.

18. The method of claim 17 , wherein generating the set of fingerprints based on the set of N-grams comprises computing a hash for each N-gram in the set of N-grams.

19. The method of claim 17 , wherein identifying the subset of batch units further comprises:

identifying one or more values in the pruning index that match one or more fingerprints in the set of fingerprints; and

identifying the subset of batch units based on the one or more values.

20. The method of claim 11 , wherein the pruning index comprises a set of filters, each filter in the set of filters corresponding to one batch unit in the set of batch units.

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

receiving a query directed at a source table organized into a set of batch units, the query including a pattern matching predicate specifying a search pattern;

generating a set of N-grams based on the search pattern;

accessing a pruning index associated with the source table, the pruning index comprising a set of filters that index distinct N-grams in each column of the source table;

identifying, using the set of N-grams generated based on the search pattern, a subset of batch units to scan for matching data based on the pruning index associated with the source table; and

processing the query by scanning the subset of batch units.

22. The computer-storage medium of claim 21 , wherein:

the operations further comprise preprocessing the search pattern before generating the set of N-grams, and

the preprocessing of the search pattern includes generating one or more preprocessed variants of the search pattern.

23. The computer-storage medium of claim 22 , wherein the preprocessing of the search pattern includes generating a case-agnostic variant of the search pattern.

24. The computer-storage medium of claim 22 , wherein the preprocessing of the search pattern includes generating one or more misspelled variants of the search pattern.

25. The computer-storage medium of claim 22 , wherein the preprocessing of the search pattern includes generating one or more synonymous variants corresponding to synonyms of the search pattern.

26. The computer-storage medium of claim 22 , wherein the preprocessing of the search pattern includes generating a variant with one or more special characters to mark a start and end of the search pattern.

27. The computer-storage medium of claim 21 , wherein identifying the subset of batch units comprises:

generating a set of fingerprints based on the set of N-grams; and

comparing the set of fingerprints to the pruning index.

28. The computer-storage medium of claim 27 , wherein generating the set of fingerprints based on the set of N-grams comprises computing a hash for each N-gram in the set of N-grams.

29. The computer-storage medium of claim 27 , wherein identifying the subset of batch units further comprises:

identifying one or more values in the pruning index that match one or more fingerprints in the set of fingerprints; and

identifying the subset of batch units based on the one or more values.

30. The computer-storage medium of claim 21 , wherein the pruning index comprises a set of filters, each filter in the set of filters corresponding to one batch unit in the set of batch units.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 19, 2021
From: CRUANES, THIERRY; DAGEVILLE, BENOIT; OUKID, ISMAIL; RICHTER, STEFAN
To: SNOWFLAKE INC.
Reel/Frame 055335/0516 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 30, 2020
From: CRUANES, THIERRY; DAGEVILLE, BENOIT; OUKID, ISMAIL; RICHTER, STEFAN
To: SNOWFLAKE INC.
Reel/Frame 054230/0543 →
Continuity (3)
Continuation In Part 16932462 · Jul 17, 2020
Continuation 16727315 · Dec 26, 2019
Provisional Application 63084394 · Sep 28, 2020
Cited By (4)
US 12,314,263 US 12,423,296 US 12,675,484 US 12,748,757