# US 2025/0094403 A1 · Dataframe workloads using read-only data snapshots

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

- Number: US 2025/0094403 A1
- Document ID: US20250094403A1
- Status: Published application
- Kind: A1
- Application number: 18/393,279
- Filed: 2023-12-21
- Published: 2025-03-20
- Earliest claimed: 2023-09-18
- Assignees: Snowflake Inc.
- Applicants: Snowflake Inc.
- Inventors: Srilakshmi Chintala; Jianzhun Du; Naresh Kumar; Srinath Shankar; Leonhard Franz Spiegelberg; Eric Shawn Vandendberg; Andong Zhan; Yun Zou
- Web page: https://patentgrep.com/patent/US20250094403A1

## CPC

- G06F 16/244: {Grouping and aggregation}
- G06F 16/128: {Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion (error detection or correction of the data by redundancy in operations or in hardware G06F11/14, G06F11/16)}
- G06F 16/2272: {Management thereof}
- G06F 16/2453: Query optimisation
- G06F 16/256: {in federated or virtual databases}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method provides deterministic row ordering for query result sets in a database system. A framework receives a query referencing a database table and generating a row index column in response. The framework generates the row index column that involves determining an order associated with source files underlying the referenced table and assigns each table row a unique index value based on the file order and row position within the files. The framework executes the received query to produce a result set ordered by the generated row index column. The framework determines row order based on analyzing underlying data file metadata and facilitates returning the result set with consistent, reliable ordering, enabling stable positional-based access semantics when querying distributed database tables.

## Claims

### Claim 1

A method comprising:
receiving, by at least one hardware processor, a query referencing a table;
in response to receiving the query, generating a row index column for rows of a referenced table, the generating of the row index column comprising:
determining an order associated with source files underlying the referenced table; and
assigning each row of the referenced table a unique row position value based on the order of the source files and a position of each row within the source files;
generating a result set based on execution of the received query, the result set being ordered based on the generated row index column to provide deterministic row ordering; and
returning the result set with the deterministic row ordering.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining the order associated with the source files comprises:
identifying names of the source files underlying the referenced table; and
sorting the source files based on the identified names.

### Claim 3 (depends on 1)

The method of claim 1, wherein assigning each row of the referenced table the unique row position value comprises:
determining an offset associated with each data file based on the order of the source files; and
assigning each row of the referenced table the unique row position value based on the offset of the data file containing the row and the position of the row within the data file.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
employing the generated row position value for the referenced table for reuse when additional queries referencing the table are received by a database system.

### Claim 5 (depends on 1)

The method of claim 1, wherein executing the received query comprises:
modifying the received query to include an ORDER BY clause based on the generated row index column.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
receiving a request to create a snapshot of the referenced table;
creating a read-only snapshot of the referenced table; and
wherein executing the received query comprises executing the query against the read-only snapshot instead of the referenced table.

### Claim 7 (depends on 6)

The method of claim 6, wherein creating the read-only snapshot further comprises:
disabling one or more background processes associated with the read-only snapshot that modify a structure of the source files associated with the read-only snapshot.

### Claim 8 (depends on 1)

The method of claim 1, wherein creating a read-only snapshot of the referenced table comprises:
generating a clone of metadata associated with the referenced table without copying data of the referenced table; and
associating a read-only access mode with the cloned table.

### Claim 9 (depends on 1)

The method of claim 1, wherein the referenced table comprises one of a database table, a view, or a snapshot.

### Claim 10 (depends on 1)

The method of claim 1, wherein assigning each row of the referenced table the unique row position value further comprises:
determining that two or more rows of the referenced table have identical values across all columns; and
assigning the two or more rows different unique row position values.

### Claim 11

A system comprising:
one or more hardware processors; and
at least one memory storing instructions that, when executed by the one or more hardware processors, cause the system to perform operations comprising:
receiving, by at least one hardware processor, a query referencing a table;
in response to receiving the query, generating a row index column for rows of a referenced table, the generating of the row index column comprising:
determining an order associated with source files underlying the referenced table; and
assigning each row of the referenced table a unique row position value based on the order of the source files and a position of each row within the source files;
generating a result set based on execution of the received query, the result set being ordered based on the generated row index column to provide deterministic row ordering; and
returning the result set with the deterministic row ordering.

### Claim 12 (depends on 11)

The system of claim 11, wherein determining the order associated with the source files comprises:
identifying names of the source files underlying the referenced table; and
sorting the source files based on the identified names.

### Claim 13 (depends on 11)

The system of claim 11, wherein assigning each row of the referenced table the unique row position value comprises:
determining an offset associated with each data file based on the order of the source files; and
assigning each row of the referenced table the unique row position value based on the offset of the data file containing the row and the position of the row within the data file.

### Claim 14 (depends on 11)

The system of claim 11, the operations comprising:
employing the generated row position values for the referenced table for reuse when additional queries referencing the table are received by a database system.

### Claim 15 (depends on 11)

The system of claim 11, wherein executing the received query comprises:
modifying the received query to include an ORDER BY clause based on the generated row index column.

### Claim 16 (depends on 11)

The system of claim 11, the operations comprising:
receiving a request to create a snapshot of the referenced table;
creating a read-only snapshot of the referenced table; and
wherein executing the received query comprises executing the query against the read-only snapshot instead of the referenced table.

### Claim 17 (depends on 16)

The system of claim 16, wherein creating the read-only snapshot further comprises: disabling one or more background processes associated with the read-only snapshot that modify a structure of the source files associated with the read-only snapshot.

### Claim 18 (depends on 11)

The system of claim 11, wherein creating a read-only snapshot of the referenced table comprises:
generating a clone of metadata associated with the referenced table without copying data of the referenced table; and
associating a read-only access mode with the cloned table.

### Claim 19 (depends on 11)

The system of claim 11, wherein the referenced table comprises one of a database table, a view, or a snapshot.

### Claim 20 (depends on 11)

The system of claim 11, wherein assigning each row of the referenced table the unique row position value further comprises:
determining that two or more rows of the referenced table have identical values across all columns; and
assigning the two or more rows different unique row position values.

### Claim 21

A machine-storage medium embodying instructions that, when executed by a machine, cause the machine to perform operations comprising:
receiving, by at least one hardware processor, a query referencing a table;
in response to receiving the query, generating a row index column for rows of a referenced table, the generating of the row index column comprising:
determining an order associated with source files underlying the referenced table; and
assigning each row of the referenced table a unique row position value based on the order of the source files and a position of each row within the source files;
generating a result set based on execution of the received query, the result set being ordered based on the generated row index column to provide deterministic row ordering; and
returning the result set with the deterministic row ordering.

### Claim 22 (depends on 21)

The machine-storage medium of claim 21, wherein determining the order associated with the source files comprises:
identifying names of the source files underlying the referenced table; and
sorting the source files based on the identified names.

### Claim 23 (depends on 21)

The machine-storage medium of claim 21, wherein assigning each row of the referenced table the unique row position value comprises:
determining an offset associated with each data file based on the order of the source files; and
assigning each row of the referenced table the unique row position value based on the offset of the data file containing the row and the position of the row within the data file.

### Claim 24 (depends on 21)

The machine-storage medium of claim 21, wherein the operations comprise:
employing the generated row position values for the referenced table for reuse when additional queries referencing the table are received by a database system.

### Claim 25 (depends on 24)

The machine-storage medium of claim 24, wherein executing the received query comprises:
modifying the received query to include an ORDER BY clause based on the generated row index column.

### Claim 26 (depends on 21)

The machine-storage medium of claim 21, wherein the operations comprise:
receiving a request to create a snapshot of the referenced table;
creating a read-only snapshot of the referenced table; and
wherein executing the received query comprises executing the query against the read-only snapshot instead of the referenced table.

### Claim 27 (depends on 26)

The machine-storage medium of claim 26, wherein creating the read-only snapshot further comprises:
disabling one or more background processes associated with the read-only snapshot that modify a structure of the source files associated with the read-only snapshot.

### Claim 28 (depends on 21)

The machine-storage medium of claim 21, wherein creating a read-only snapshot of the referenced table comprises:
generating a clone of metadata associated with the referenced table without copying data of the referenced table; and
associating a read-only access mode with the cloned table.

### Claim 29 (depends on 21)

The machine-storage medium of claim 21, wherein the referenced table comprises one of a database table, a view, or a snapshot.

### Claim 30 (depends on 21)

The machine-storage medium of claim 21, wherein assigning each row of the referenced table the unique row position value further comprises:
determining that two or more rows of the referenced table have identical values across all columns; and
assigning the two or more rows different unique row position values.
