IP Library Granted Patent US 10,997,212
Granted Patent B2
US 10,997,212 · App. 17/062,859 · Granted May 4, 2021

Storing database metadata in multiple levels

Inventors: Ashish Motivala (Foster City, CA); Yi Fang (Kirkland, WA); Martin Hentschel (Berlin, DE); Benoit Dageville (San Mateo, CA); Spyridon Triantafyllis (San Mateo, CA); Yizhi Zhu (Bellevue, WA)
Assignee: Snowflake Inc.
G06F16/278G06F16/221G06F16/245
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,212
App. No.
17/062,859
Granted
May 4, 2021
Kind
B2
Abstract

The subject technology stores database data in a table, the table comprising a plurality of micro-partitions each having rows and columns. The subject technology stores metadata for the table in a data structure, the metadata comprising a first level of the data structure comprising a column expression property comprising information about data stored in a column of a micro-partition of the table, a micro-partition expression property comprising information about data stored in the micro-partition of the table, and a second level of the data structure comprising a grouping expression property comprising information about data stored in the micro-partition and one or more additional micro-partitions of the table.

Claims (98)

1. A system comprising:

at least one processor;

a memory device including instructions, which when executed by the at least one processor, cause the at least one processor to perform operations comprising:

storing database data in a table, the table comprising a plurality of micro-partitions each having rows and columns; and

storing metadata for the table in a data structure, the metadata comprising:

a first level of the data structure comprising:

a column expression property comprising information about data stored in a column of a micro-partition of the table,

a micro-partition expression property comprising information about data stored in the micro-partition of the table, and

a second level of the data structure comprising:

a grouping expression property comprising information about data stored in the micro-partition and one or more additional micro-partitions of the table.

2. The system of claim 1 , wherein the metadata further comprises:

a third level of the data structure comprising:

cumulative table metadata comprising global information about the plurality of micro-partitions of the table.

3. The system of claim 2 , wherein the third level is above the second level in the data structure, the second level is above the first level in the data structure.

4. The system of claim 3 , wherein the data structure comprises a tree structure.

5. The system of claim 2 , wherein the cumulative table metadata is stored in a metadata micro-partition associated with the table, the metadata micro-partition including information comprising at least one of:

a list of all added table data micro-partitions, or

a list of deleted table data micro-partitions.

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

receiving a query on the database, the query comprising a predicate;

evaluating the predicate against the cumulative table metadata to determine whether data stored in the table matches the predicate; and

in response to determining that no data stored in the table matches the predicate, pruning the table such that the table is not scanned to respond to the query.

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

caching the cumulative table metadata in a cache of at least one node of a resource manager, wherein the at least one node comprises a processor and the cache.

8. The system of claim 1 , wherein the column expression property comprises at least one of:

a summary of database data stored in the column, or

a type of database data stored in the column.

9. The system of claim 1 , wherein the grouping expression property comprises at least one of:

a summary of database data collectively stored across the micro-partition and the one or more additional micro-partitions, or

a type of data collectively stored across the micro-partition and the one or more additional micro-partitions.

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

executing a transaction on the table by generating a new micro-partition reflecting an update to the data caused by the transaction;

generating a new column expression to reflect at least one update made to the data stored in the column by the transaction; and

generating a new micro-partition expression property to reflect at least one update made to the data stored in the micro-partition by the transaction.

11. A method comprising:

storing database data in a table, the table comprising a plurality of micro-partitions each having rows and columns; and

storing metadata for the table in a data structure, the metadata comprising:

a first level of the data structure comprising:

a column expression property comprising information about data stored in a column of a micro-partition of the table,

a micro-partition expression property comprising information about data stored in the micro-partition of the table, and

a second level of the data structure comprising:

a grouping expression property comprising information about data stored in the micro-partition and one or more additional micro-partitions of the table.

12. The method of claim 11 , wherein the metadata further comprises:

a third level of the data structure comprising:

cumulative table metadata comprising global information about the plurality of micro-partitions of the table.

13. The method of claim 12 , wherein the third level is above the second level in the data structure, the second level is above the first level in the data structure.

14. The method of claim 13 , wherein the data structure comprises a tree structure.

15. The method of claim 12 , wherein the cumulative table metadata is stored in a metadata micro-partition associated with the table, the metadata micro-partition including information comprising at least one of:

a list of all added table data micro-partitions, or

a list of deleted table data micro-partitions.

16. The method of claim 12 , further comprising:

receiving a query on the database, the query comprising a predicate;

evaluating the predicate against the cumulative table metadata to determine whether data stored in the table matches the predicate; and

in response to determining that no data stored in the table matches the predicate, pruning the table such that the table is not scanned to respond to the query.

17. The method of claim 12 , further comprising:

caching the cumulative table metadata in a cache of at least one node of a resource manager, wherein the at least one node comprises a processor and the cache.

18. The method of claim 11 , wherein the column expression property comprises at least one of:

a summary of database data stored in the column, or

a type of database data stored in the column.

19. The method of claim 11 , wherein the grouping expression property comprises at least one of:

a summary of database data collectively stored across the micro-partition and the one or more additional micro-partitions, or

a type of data collectively stored across the micro-partition and the one or more additional micro-partitions.

20. The method of claim 11 , further comprising:

executing a transaction on the table by generating a new micro-partition reflecting an update to the data caused by the transaction;

generating a new column expression to reflect at least one update made to the data stored in the column by the transaction; and

generating a new micro-partition expression property to reflect at least one update made to the data stored in the micro-partition by the transaction.

21. A non-transitory computer-readable medium comprising instructions, which when executed by at least one processor, cause the at least one processor to perform operations comprising:

storing database data in a table, the table comprising a plurality of micro-partitions each having rows and columns; and

storing metadata for the table in a data structure, the metadata comprising:

a first level of the data structure comprising:

a column expression property comprising information about data stored in a column of a micro-partition of the table,

a micro-partition expression property comprising information about data stored in the micro-partition of the table, and

a second level of the data structure comprising:

a grouping expression property comprising information about data stored in the micro-partition and one or more additional micro-partitions of the table.

22. The non-transitory computer-readable medium of claim 21 , wherein the metadata further comprises:

a third level of the data structure comprising:

cumulative table metadata comprising global information about the plurality of micro-partitions of the table.

23. The non-transitory computer-readable medium of claim 22 , wherein the third level is above the second level in the data structure, the second level is above the first level in the data structure.

24. The non-transitory computer-readable medium of claim 23 , wherein the data structure comprises a tree structure.

25. The non-transitory computer-readable medium of claim 22 , wherein the cumulative table metadata is stored in a metadata micro-partition associated with the table, the metadata micro-partition including information comprising at least one of:

a list of all added table data micro-partitions, or

a list of deleted table data micro-partitions.

26. The non-transitory computer-readable medium of claim 22 , wherein the operations further comprise:

receiving a query on the database, the query comprising a predicate;

evaluating the predicate against the cumulative table metadata to determine whether data stored in the table matches the predicate; and

in response to determining that no data stored in the table matches the predicate, pruning the table such that the table is not scanned to respond to the query.

27. The non-transitory computer-readable medium of claim 22 , wherein the operations further comprise:

caching the cumulative table metadata in a cache of at least one node of a resource manager, wherein the at least one node comprises a processor and the cache.

28. The non-transitory computer-readable medium of claim 21 , wherein the column expression property comprises at least one of:

a summary of database data stored in the column, or

a type of database data stored in the column.

29. The non-transitory computer-readable medium of claim 21 , wherein the grouping expression property comprises at least one of:

a summary of database data collectively stored across the micro-partition and the one or more additional micro-partitions, or

a type of data collectively stored across the micro-partition and the one or more additional micro-partitions.

30. The non-transitory computer-readable medium of claim 21 , wherein the operations further comprise:

executing a transaction on the table by generating a new micro-partition reflecting an update to the data caused by the transaction;

generating a new column expression to reflect at least one update made to the data stored in the column by the transaction; and

generating a new micro-partition expression property to reflect at least one update made to the data stored in the micro-partition by the transaction.

Assignments (4)
CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTION DATE PREVIOUSLY RECORDED AT REEL: 054440 FRAME: 0712. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Aug 17, 2021
From: SNOWFLAKE COMPUTING INC.
To: SNOWFLAKE INC.
Reel/Frame 057246/0097 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 22, 2021
From: TRIANTAFYLLIS, SPYRIDON
To: SNOWFLAKE INC.
Reel/Frame 055673/0548 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 23, 2020
From: MOTIVALA, ASHISH; FANG, YI; HENTSCHEL, MARTIN; DAGEVILLE, BENOIT; TRIANTAFYLLIS, SPYROS; ZHU, YIZHI
To: SNOWFLAKE COMPUTING INC.
Reel/Frame 054440/0665 →
CHANGE OF NAME Recorded Nov 23, 2020
From: SNOWFLAKE COMPUTING INC.
To: SNOWFLAKE INC.
Reel/Frame 054440/0712 →
Continuity (3)
Continuation 16775092 · Jan 28, 2020
Continuation 16283431 · Feb 22, 2019
Related Publication 20210019334A1 · Jan 21, 2021