# US 2021/0240690 A1 · Streams on shared database objects

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0240690 A1
- Document ID: US20210240690A1
- Status: Published application
- Kind: A1
- Application number: 16/779,045
- Filed: 2020-01-31
- Published: 2021-08-05
- Earliest claimed: 2020-01-31
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Istvan Cseri; Dinesh Chandrakant Kulkarni
- Web page: https://patentgrep.com/patent/US20210240690A1

## CPC

- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/162: {Delete operations (erasing in storage systems G06F3/0652)}
- G06F 16/168: {Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs (query results presentation G06F16/156)}
- G06F 16/1734: {Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs}
- G06F 16/182: Distributed file systems
- G06F 16/1865: {Transactional file systems}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F 16/24573: {using data annotations, e.g. user-defined metadata}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A database platform can track changes using a stream that records changes made by database transactions. Streams on views can be implemented by applying a stream to source data, and applying the view to the streamed data. Users of the database platform can query the stream on the view to review recent changes to the view, such as changes made since the last database transaction.

## Claims

### Claim 1

A method comprising:
identifying, by one or more processors of a machine, a database view of one or more source tables of a database platform, the database view comprising a table definition specifying data to include in the database view from the one or more source tables;
receiving a query that specifies a database stream object to be applied to the database view to track changes made to the database view, the database stream object recording one or more row level changes to the database view caused by one or more database transactions, the one or more row level changes being tracked in a change table of the database stream object; and
in response to the query, performing query expansion to rearrange a query plan such that the database stream object is applied to the one or more source tables and the database view is applied to the change table;
receiving an additional query for change data from the database stream object;
generating, using the rearranged query plan, the change data by generating intermediate change data by applying the additional query to the change table that tracks changes made to the one or more source tables and applying the database view on the intermediate change data to generate the change data; and
storing the change data.

### Claim 2

(canceled)

### Claim 3 (depends on 1)

The method of claim 1, wherein the one or more source tables comprises a plurality of tables, and wherein the database view is generated from the plurality of tables.

### Claim 4 (depends on 3)

The method of claim 3, wherein the change table comprises indications of changes to one of the plurality of tables.

### Claim 5 (depends on 4)

The method of claim 4, wherein changes to other tables of the plurality of tables are not indicated in the change table.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
generating the database stream object at least in part by appending metadata columns to the one or more source tables to generate the change table.

### Claim 7 (depends on 6)

The method of claim 6, wherein the metadata columns describe the one or more row level changes made in each transaction of the one or more database transactions.

### Claim 8 (depends on 7)

The method of claim 7, wherein the one or more row level changes described by the metadata columns include one or more of: an insert operation, an update operation, or a delete operation.

### Claim 9 (depends on 1)

The method of claim 1, wherein the database view and the one or more source tables are managed by a data provider end-user of the database platform, and the database stream object is managed by a data consumer end-user of the database platform.

### Claim 10 (depends on 9)

The method of claim 9, wherein the database view is a secure database view having restricted access to tables from which the secure database view includes data, and wherein the method further comprises:
receiving, from the data provider end-user, a request to share the secure database view on the database platform with the data consumer end-user without enabling access to the one or more source tables by the data consumer end-user; and
causing, on a user device of the data consumer end-user, display of data from the secure database view.

### Claim 11

(canceled)

### Claim 12 (depends on 1)

The method of claim 1, wherein the one or more source tables comprises a plurality of tables, and wherein the database view includes data from different tables of the plurality of tables using a join operation included in the database view.

### Claim 13 (depends on 1)

The method of claim 1, wherein each of the one or more database transactions includes one or more read operations or write operations.

### Claim 14

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:
identifying, in a database platform, a database view of one or more source tables, the database view comprising a table definition specifying data to include in the database view from the one or more source tables;
receiving a query that specifies a database stream object to be applied to the database view to track changes made to the database view, the database stream object recording one or more row level changes to the database view caused by one or more database transactions, the one or more row level changes being tracked in a change table of the database stream object; and
in response to the query, performing query expansion to rearrange a query plan such that the database stream object is applied to the one or more source tables and the database view is applied to the change table;
receiving an additional query for change data from the database stream object;
generating, using the rearranged query plan, the change data by generating intermediate change data by applying the additional query to the change table that tracks changes made to the one or more source tables and applying the database view on the intermediate change data to generate the change data; and
storing the change data.

### Claim 15

(canceled)

### Claim 16 (depends on 14)

The system of claim 14, wherein the one or more source tables comprises a plurality of tables, and wherein the database view is generated from the plurality of tables.

### Claim 17 (depends on 16)

The system of claim 16, wherein the change table comprises indications of changes to one of the plurality of tables.

### Claim 18 (depends on 17)

The system of claim 17, wherein changes to other tables of the plurality of tables are not indicated in the change table.

### Claim 19 (depends on 14)

The system of claim 14, the operations further comprising:
generating the database stream object at least in part by appending metadata columns to the one or more source tables to generate the change table.

### Claim 20 (depends on 19)

The system of claim 19, wherein the metadata columns describe the one or more row level changes made in each transaction of the one or more database transactions.

### Claim 21 (depends on 20)

The system of claim 20, wherein the one or more row level changes described by the metadata columns include one or more of: an insert operation, an update operation, or a delete operation.

### Claim 22 (depends on 14)

The system of claim 14, wherein the database view and the one or more source tables are managed by a data provider end-user of the database platform, and the database stream object is managed by a data consumer end-user of the database platform.

### Claim 23 (depends on 22)

The system of claim 22, wherein the database view is a secure database view having restricted access to tables from which the secure database view includes data, and wherein the operations further comprise:
receiving, from the data provider end-user, a request to share the secure database view on the database platform with the data consumer end-user without enabling access to the one or more source tables by the data consumer end-user; and
causing, on a user device of the data consumer end-user, display of data from the secure database view.

### Claim 24

(canceled)

### Claim 25

A machine storage medium embodying instructions that,
when executed by a machine, cause the machine to perform operations comprising:
identifying, in a database platform, a database view of one or more source tables, the database view comprising a table definition specifying data to include in the database view from the one or more source tables;
receiving a query that specifies a database stream object to be applied to the database view to track changes made to the database view, the database stream object recording one or more row level changes to the database view caused by one or more database transactions, the one or more row level changes being tracked in a change table of the database stream object; and
in response to the query, performing query expansion to rearrange a query plan such that the database stream object is applied to the one or more source tables and the database view is applied to the change table;
receiving an additional query for change data from the database stream object;
generating, using the rearranged query plan, the change data by generating intermediate change data by applying the additional query to the change table that tracks changes made to the one or more source tables and applying the database view on the intermediate change data to generate the change data; and
storing the change data.

### Claim 26

(canceled)

### Claim 27 (depends on 25)

The machine storage medium of claim 25, wherein the one or more source tables comprises a plurality of tables, and wherein the database view is generated from the plurality of tables.

### Claim 28 (depends on 27)

The machine storage medium of claim 27, wherein the change table comprises indications of changes to one of the plurality of tables.

### Claim 29 (depends on 28)

The machine storage medium of claim 28, wherein changes to other tables of the plurality of tables are not indicated in the change table.

### Claim 30 (depends on 25)

The machine storage medium of claim 25, the operations further comprising:
generating the database stream object at least in part by appending metadata columns to the one or more source tables to generate the change table.

### Claim 31 (depends on 14)

The system of claim 14, wherein the one or more source tables comprises a plurality of tables, and wherein the database view includes data from different tables of the plurality of tables using a join operation included in the database view.

### Claim 32 (depends on 14)

The system of claim 14, wherein each of the one or more database transactions includes one or more read operations or write operations.

### Claim 33 (depends on 30)

The machine storage medium of claim 30, wherein the metadata columns describe the one or more row level changes made in each transaction of the one or more database transactions.

### Claim 34 (depends on 33)

The machine storage medium of claim 33, wherein the one or more row level changes described by the metadata columns include one or more of: an insert operation, an update operation, or a delete operation.

### Claim 35 (depends on 25)

The machine storage medium of claim 25, wherein the database view and the one or more source tables are managed by a data provider end-user of the database platform, and the database stream object is managed by a data consumer end-user of the database platform.
