IP Library Granted Patent US 11,106,661
Granted Patent B2
US 11,106,661 · App. 17/219,600 · Granted Aug 31, 2021

Tracking intermediate changes in database data

Inventors: Torsten Grabs (San Mateo, CA); Istvan Cseri (Seattle, WA); Benoit Dageville (San Mateo, CA)
Assignee: Snowflake Inc.
G06F16/2379G06F16/2282G06F16/2456G06F16/24554
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 11,106,661
App. No.
17/219,600
Granted
Aug 31, 2021
Kind
B2
Abstract

Systems, methods, and devices for tracking a series of changes to database data are disclosed. A method includes executing a transaction to modify data in a micro-partition of a table of a database by generating a new micro-partition that embodies the transaction. The method includes associating transaction data with the new micro-partition, wherein the transaction data comprises a timestamp when the transaction was fully executed, and further includes associating modification data with the new micro-partition that comprises an indication of one or more rows of the table that were modified by the transaction. The method includes joining the transaction data with the modification data to generate joined data and querying the joined data to determine a listing of intermediate modifications made to the table between a first timestamp and a second timestamp.

Claims (56)

1. A method comprising:

maintaining stored data in a first micro-partition of a data structure, the stored data being associated with a first timestamp;

in response to a transaction, generating transaction data associated with the transaction and performing one or more modifications to the stored data in the first micro-partition to generate a second micro-partition based on at least the one or more modifications to the stored data, the second micro-partition being generated at a second timestamp;

generating modification data, the modification data tracking the modifications performed to the stored data in the first and second micro-partitions between the first and second timestamps;

joining the modification data with the transaction data to generate joined data;

receiving a query; and

executing the query using the joined data to determine intermediate changes to the stored data between the first and second timestamps.

2. The method of claim 1 , wherein querying the joined data includes calculating tuple changes between each of a series of sequential micro-partition pairs between the first and second timestamps.

3. The method of claim 1 , further comprising:

performing multiple modifications to a row of a plurality of rows in the first micro-partition,

wherein the joined data indicates at least one intermediate change to the row between the initial and final values.

4. The method of claim 1 , further comprising:

generating a delta table, the delta table storing final changes to the stored data in the second micro-partition at the second timestamp from the first micro-partition at the first timestamp.

5. The method of claim 4 , further comprising:

performing multiple modifications to a row of a plurality of rows in the first micro-partition,

wherein the delta table stores an initial value of the row at the first timestamp and a final value of the row after performance of the multiple modifications to the row at the second timestamp.

6. The method of claim 5 , wherein the delta table includes information indicating which rows have been modified, final values of rows that have been modified between the first and second timestamps, and an action type of the modification for each row modified.

7. The method of claim 1 , further comprising:

storing the transaction data in the second micro-partition as metadata, wherein the transaction data includes one or more of: an identity of an account that initiated the transaction, the second time stamp, a third timestamp when the transaction was requested, a fourth timestamp when execution of the transaction began, a listing of all rows that were modified by the transaction, and details of the modifications.

8. The method of claim 1 , further comprising:

storing the modification data in the second micro-partition as metadata, wherein the modification data includes a lineage of modifications made to the table.

9. The method of claim 1 , further comprising:

storing the transaction data and the modification data in the second micro-partition as metadata, wherein the metadata is stored in immutable storage.

10. A system comprising:

one or more processors of a machine; and

a memory storing instructions that, when executed by the one or more processors, cause the machine to perform operations comprising:

maintaining stored data in a first micro-partition of a data structure, the stored data being associated with a first timestamp;

in response to a transaction, generating transaction data associated with the transaction and performing one or more modifications to the stored data in the first micro-partition to generate a second micro-partition based on at least the one or more modifications to the stored data, the second micro-partition being generated at a second timestamp;

generating modification data, the modification data tracking the modifications performed to the stored data in the first and second micro-partitions between the first and second timestamps;

joining the modification data with the transaction data to generate joined data;

receiving a query; and

executing the query using the joined data to determine intermediate changes to the stored data between the first and second timestamps.

11. The system of claim 10 , wherein querying the joined data includes calculating tuple changes between each of a series of sequential micro-partition pairs between the first and second timestamps.

12. The system of claim 10 , the operations further comprising:

performing multiple modifications to a row of a plurality of rows in the first micro-partition,

wherein the joined data indicates at least one intermediate change to the row between the initial and final values.

13. The system of claim 10 , the operations further comprising:

generating a delta table, the delta table storing final changes to the stored data in the second micro-partition at the second timestamp from the first micro-partition at the first timestamp.

14. The system of claim 13 , the operations further comprising:

performing multiple modifications to a row of a plurality of rows in the first micro-partition,

wherein the delta table stores an initial value of the row at the first timestamp and a final value of the row after performance of the multiple modifications to the row at the second timestamp.

15. The system of claim 13 , wherein the delta table includes information indicating which rows have been modified, final values of rows that have been modified between the first and second timestamps, and an action type of the modification for each row modified.

16. The system of claim 1 , the operations further comprising:

storing the transaction data in the second micro-partition as metadata, wherein the transaction data includes one or more of: an identity of an account that initiated the transaction, the second time stamp, a third timestamp when the transaction was requested, a fourth timestamp when execution of the transaction began, a listing of all rows that were modified by the transaction, and details of the modifications.

17. The system of claim 1 , the operations further comprising:

storing the modification data in the second micro-partition as metadata, wherein the modification data includes a lineage of modifications made to the table.

18. The system of claim 1 , the operations further comprising:

storing the transaction data and the modification data in the second micro-partition as metadata, wherein the metadata is stored in immutable storage.

19. A non-transitory computer readable storage media storing instructions that, when executed by one or more processors, cause the one or more processors to:

maintaining stored data in a first micro-partition of a data structure, the stored data being associated with a first timestamp;

in response to a transaction, generating transaction data associated with the transaction and performing one or more modifications to the stored data in the first micro-partition to generate a second micro-partition based on at least the one or more modifications to the stored data, the second micro-partition being generated at a second timestamp;

generating modification data, the modification data tracking the modifications performed to the stored data in the first and second micro-partitions between the first and second timestamps;

joining the modification data with the transaction data to generate joined data;

receiving a query; and

executing the query using the joined data to determine intermediate changes to the stored data between the first and second timestamps.

20. The non-transitory computer readable storage media of claim 19 , wherein querying the joined data includes calculating tuple changes between each of a series of sequential micro-partition pairs between the first and second timestamps.

Assignments (3)
CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTIION DATE PREVIOUSLY RECORDED AT REEL: 056742 FRAME: 0800. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jul 22, 2021
From: SNOWFLAKE COMPUTING INC.
To: SNOWFLAKE INC.
Reel/Frame 056964/0808 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 2, 2021
From: GRABS, TORSTEN; CSERI, ISTVAN; DAGEVILLE, BENOIT
To: SNOWFLAKE COMPUTING INC.
Reel/Frame 056742/0504 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 2, 2021
From: SNOWFLAKE COMPUTING, INC.
To: SNOWFLAKE INC.
Reel/Frame 056742/0800 →
Continuity (3)
Continuation 16824676 · Mar 19, 2020
Continuation 16182216 · Nov 6, 2018
Related Publication 20210216535A1 · Jul 15, 2021
Cited By (1)
US 12,405,924