IP Library Granted Patent US 11,308,078
Granted Patent B2
US 11,308,078 · App. 17/389,234 · Granted Apr 19, 2022

Triggers of scheduled tasks in database systems

Inventors: Istvan Cseri (Seattle, WA); Torsten Grabs (San Mateo, CA); Benoit Dageville (San Mateo, CA)
Assignee: Snowflake Inc.
G06F16/2379G06F9/466G06F16/2308
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,308,078
App. No.
17/389,234
Granted
Apr 19, 2022
Kind
B2
Abstract

Systems, methods, and devices for executing a task on database data in response to a trigger event are disclosed. A method includes executing a transaction on a table comprising database data, wherein executing the transaction comprises generating a new table version. The method includes, in response to the transaction being fully executed, generating a change tracking entry comprising an indication of one or more modifications made to the table by the transaction and storing the change tracking entry in a change tracking stream. The method includes executing a task on the new table version in response to a trigger event.

Claims (55)

1. A method comprising:

executing a transaction on a table comprising one or more immutable micro-partitions storing database data, the executing of the transaction comprising generating a new table version including updated database data that reflects the transaction;

in response to the transaction being fully executed, generating a change tracking entry distinct from the new table, comprising an indication of one or more modifications made to the table by the transaction;

advancing a change tracking stream at least in part by entering the change tracking entry into the change tracking stream, the advancing comprising advancing a retention boundary in the change tracking stream, the retention boundary indicative of a retention period of the table;

querying the change tracking stream to determine whether a scheduled task is to be executed based on at least a portion of the one or more modifications entered in the change tracking stream subsequent to the retention boundary; and

in accordance with the determination the scheduled task is to be executed, executing the scheduled task.

2. The method of claim 1 , further comprising advancing a stream offset in the change tracking stream in response to the change tracking entry being entered into in the change tracking stream.

3. The method of claim 1 , wherein the scheduled task is user defined.

4. The method of claim 3 , wherein the scheduled task is a task to be repeated based on a trigger event.

5. The method of claim 4 , wherein the trigger event is the advancing of the change tracking stream in response to the transaction being fully executed and passage of a predefined time interval.

6. The method of claim 1 , wherein the transaction comprises one or more of an insertion of data into the table, a deletion of data from the table, and an update of data in the table.

7. The method of claim 1 , wherein the task comprises user-defined logic comprising one or more structured query language (SQL) statements.

8. The method of claim 1 , wherein:

the change tracking stream advances after the transaction is fully and successfully executed; and

the task is executed on the new table version once.

9. The method of claim 1 , further comprising, in response to executing the task on the new table version, generating a task history entry comprising one or more of:

a task name;

a task identification;

an execution timestamp indicating when the task was executed;

an execution status indicating whether the task was successfully executed or whether an error was returned;

a message comprising an error code in response to the task not being executed successfully; and

one or more results returned by executing the task.

10. The method of claim 1 , further comprising retrieving the task from database schema, wherein the task comprises one or more of:

a timestamp indicating when the task was received;

a timestamp indicating when the task was generated;

a task name;

a database name indicating the database the task is to be executed;

an identifier of an owner of the task;

an identifier of a creator of the task;

a task schedule for the task;

a structured query language (SQL) script;

a last execution timestamp indicating a last time the task was executed; and

a last execution status indicating whether the task was executed successfully the last time the task was executed.

11. A system comprising:

at least one processor; and

one or more non-transitory computer readable storage media containing instructions that, when executed by the at least one processor, cause the at least one processor to perform operations comprising:

executing a transaction on a table comprising one or more immutable micro-partitions storing database data, the executing of the transaction comprising generating a new table version including updated database data that reflects the transaction;

generating a change tracking entry in response to the transaction being fully executed, the change tracking entry being distinct from the new table and comprising an indication of one or more modifications made to the table by the transaction;

advancing a change tracking stream at least in part by entering the change tracking entry into the change tracking stream, the advancing comprising advancing a retention boundary in the change tracking stream, the retention boundary indicative of a retention period of the table;

querying the change tracking stream to determine whether a scheduled task is to be executed based on at least a portion of the one or more modifications entered in the change tracking stream subsequent to the retention boundary; and

in accordance with the determination the scheduled task is to be executed, executing the scheduled task.

12. The system of claim 11 , further comprising advancing a stream offset in the change tracking stream in response to the change tracking entry being entered into in the change tracking stream.

13. The system of claim 11 , wherein the schedule task is user defined.

14. The system of claim 13 , wherein the scheduled task is a task to be repeated based on a trigger event.

15. The system of claim 14 , wherein the trigger event is the advancing of the change tracking stream in response to the transaction being fully executed and passage of a predefined time interval.

16. Non-transitory computer readable storage media storing instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:

executing a transaction on a table comprising one or more immutable micro-partitions storing database data, the executing of the transaction comprising generating a new table version including updated database data that reflects the transaction;

in response to the transaction being fully executed, generating a change tracking entry distinct from the new table, comprising an indication of one or more modifications made to the table by the transaction;

advancing a change tracking stream at least in part by entering the change tracking entry into the change tracking stream, the advancing comprising advancing a retention boundary in the change tracking stream, the retention boundary indicative of a retention period of the table;

querying the change tracking stream to determine whether a scheduled task is to be executed based on at least a portion of the one or more modifications entered in the change tracking stream subsequent to the retention boundary; and

in accordance with the determination the scheduled task is to be executed, executing the scheduled task.

17. The non-transitory computer readable storage media of claim 16 , the operations further comprising advancing a stream offset in the change tracking stream in response to the change tracking entry being entered into in the change tracking stream.

18. The non-transitory computer readable storage media of claim 16 , wherein the scheduled task is user defined.

19. The non-transitory computer readable storage media of claim 18 , wherein the scheduled task is a task to be repeated based on a trigger event.

20. The non-transitory computer readable storage media of claim 19 , wherein the trigger event is the advancing of the change tracking stream in response to the transaction being fully executed and passage of a predefined time interval.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 6, 2021
From: CSERI, ISTVAN; GRABS, TORSTEN; DAGEVILLE, BENOIT
To: SNOWFLAKE COMPUTING, INC.
Reel/Frame 057102/0526 →
CHANGE OF NAME Recorded Aug 6, 2021
From: SNOWFLAKE COMPUTING, INC.
To: SNOWFLAKE INC.
Reel/Frame 057102/0604 →
Continuity (2)
Continuation 16203322 · Nov 28, 2018
Related Publication 20210357391A1 · Nov 18, 2021
Cited By (3)
US 12,417,228 US 12,436,954 US 12,450,126