# US 2025/0156400 A1 · Schema snapshot isolation access in a relational database

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

- Number: US 2025/0156400 A1
- Document ID: US20250156400A1
- Status: Published application
- Kind: A1
- Application number: 18/428,887
- Filed: 2024-01-31
- Published: 2025-05-15
- Earliest claimed: 2023-11-14
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Noah Amin AL-SHIHABI; Panagiotis ANTONOPOULOS; Hanumantha Rao KODAVALLA; Nikolas Christopher OGG; Divyesh Rameshchandra TIKMANI; Wonseok KIM; Alexander Wai-man SWANSON; Rajat JAIN
- Web page: https://patentgrep.com/patent/US20250156400A1

## CPC

- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 16/2308: {Concurrency control (transaction processing G06F9/466)}
- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 16/24542: {Plan optimisation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Relational database systems are disclosed that are enabled to operate with versioned metadata. The relational database system includes a lock manager, a transaction manager and a version aware metadata storage and cache configured to store to store and manage versions of metadata, to determine which of such versions should be visible at any given point in time, and to enable creation of the proper versions of metadata. In an aspect, the transaction manager manages transaction identifiers and their associated start times, abort times and/or commit times. Such data enables determination of transaction visibility, and consequently the metadata version visibility, for any point in time. In an aspect, such metadata versioning support enables snapshot isolation of metadata transactions.

## Claims

### Claim 1

A relational database system, comprising:
a processor; and
a memory that stores program code structured to cause the processor to:
receive a single data read command comprising first and second queries that both read data objects, each query referencing a metadata object in metadata storage of the relational database system and configured to read user data objects from a user data storage of the relational database system;
receive a metadata modification command to be executed concurrently with the data read command, and wherein execution of the metadata modification command causes the metadata object stored in a metadata storage of the relational database system to be modified;
in response to receiving the data read command:
start a first transaction at a time T1;
obtain a metadata access lock from a lock manager of the relational database system;
create a first query plan for the first query, wherein the first query plan references the metadata object;
begin execution of the first query plan inside the first transaction at a time T2 using the metadata access lock;
complete execution of the first query plan at a time T3; and
commit the first transaction at a time T4; and
in response to receiving the metadata modification command:
start a second transaction concurrently with the first transaction at a time T5;
obtain a metadata change lock from the lock manager;
modify the metadata object inside the second transaction using the metadata change lock, wherein the modification is not blocked by the metadata access lock; and
commit the second transaction at a time T6.

### Claim 2 (depends on 1)

The relational database system of claim 1, wherein said time T2 is subsequent to said time T1, said time T5 is subsequent to said time T2, said time T3 is subsequent to said time T5 and said time T6 is subsequent to said time T3.

### Claim 3 (depends on 2)

The relational database system of claim 2, wherein prior to executing the metadata modification command, the metadata object comprises a first version of the metadata object.

### Claim 4 (depends on 3)

The relational database system of claim 3, wherein executing the metadata modification command causes the first version of the metadata object to be modified into a second version of the metadata object.

### Claim 5 (depends on 4)

The relational database system of claim 4, wherein to operate in a read committed snapshot isolation mode, the program code is further structured to cause the processor to:
execute the second query inside the first transaction at a time prior to T6 causing a second query plan to be compiled, wherein the second query plan references the first version of the metadata object; and
execute the second query a second time inside the first transaction at a time subsequent to said time T6 causing the second query plan to be recompiled to generate a third query plan, wherein the third query plan references the second version of the metadata object.

### Claim 6 (depends on 4)

The relational database system of claim 4, wherein to operate in a regular snapshot isolation mode, the program code is further structured to cause the processor to:
execute the second query inside the first transaction at a time either prior to or subsequent to said time T6 causing a second query plan to be compiled wherein the second query plan references the first version of the metadata object; and
execute the second query a second time inside the first transaction at a time subsequent to said time T6 reusing the second query plan.

### Claim 7 (depends on 5)

The relational database system of claim 5, further comprising a transaction manager configured to determine which of the first version or the second version of the metadata object is visible to a transaction at a predetermined time.

### Claim 8 (depends on 7)

The relational database system of claim 7, wherein the transaction manager is further configured to determine which of the first version or the second version of the metadata object is visible to a transaction at a predetermined time based at least in part on whether the program code is configured to operate in a first snapshot isolation mode, a second snapshot isolation mode or a non-snapshot isolation mode.

### Claim 9

A method in a relational database system, the method comprising:
receiving a data read command comprising first and second queries, each query referencing a metadata object in a metadata storage of the relational database system and configured to read user data objects from a user data storage of the relational database system;
receiving a metadata modification command to be executed concurrently with the data read command, and wherein execution of the metadata modification command causes the metadata object to be modified;
in response to receiving the data read command:
starting a first transaction at a time T1;
obtaining a metadata access lock from a lock manager of the relational database system;
creating a first query plan for the first query, wherein the first query plan references the metadata object;
beginning execution of the first query plan inside the first transaction at a time T2 using the metadata access lock;
completing execution of the first query plan at a time T3; and
committing the first transaction at a time T4; and
in response to receiving the metadata modification command:
starting a second transaction concurrently with the first transaction at a time T5;
obtaining a metadata change lock from the lock manager;
modifying the metadata object inside the second transaction using the metadata change lock, wherein the modification is not blocked by the metadata access lock; and
committing the second transaction at a time T6;
wherein said time T2 is subsequent to said time T1, said time T5 is subsequent to said time T2, said time T3 is subsequent to said time T5, and said time T6 is subsequent to said time T3.

### Claim 10

(canceled)

### Claim 11 (depends on 9)

The method of claim 9, wherein prior to executing the metadata modification command, the metadata object comprises a first version of the metadata object.

### Claim 12 (depends on 11)

The method of claim 11 wherein executing the metadata modification command causes the first version of the metadata object to be modified into a second version of the metadata object.

### Claim 13 (depends on 12)

The method of claim 12 further comprises operating the relational database system in a first snapshot isolation mode and:
executing the second query inside the first transaction at a time prior to T6 causing a second query plan to be compiled, wherein the second query plan references the first version of the metadata object; and
executing the second query a second time inside the first transaction at a time subsequent to said time T6 causing the second query plan to be recompiled to generate a third query plan, wherein the third query plan references the second version of the metadata object.

### Claim 14 (depends on 12)

The method of claim 12 further comprises operating the relational database system in a second snapshot isolation mode and executing the second query inside the first transaction at a time either prior to or subsequent to said time T6 causing a second query plan to be compiled wherein the second query plan references the first version of the metadata object.

### Claim 15

A computer program product comprising a computer-readable memory device having computer program logic recorded thereon that when executed by at least one processor of a computing device causes the at least one processor to perform operations, the operations comprising:
receiving a data read command comprising first and second queries, each query referencing a metadata object in a metadata object in a metadata storage of the relational database system and configured to read user data objects from a user data storage of the relational database system;
receiving a metadata modification command to be executed concurrently with the data read command, and wherein execution of the metadata modification command causes the metadata object to be modified;
in response to receiving the data read command:
starting a first transaction at a time T1;
obtaining a metadata access lock from a lock manager of the relational database system;
creating a first query plan for the first query, wherein the first query plan references the metadata object;
begin executing the first query plan inside the first transaction at a time T2 using the metadata access lock;
completing execution of the first query plan at a time T3; and
committing the first transaction at a time T4; and
in response to receiving the metadata modification command:
starting a second transaction concurrently with the first transaction at a time T5;
obtaining a metadata change lock;
modifying the metadata object inside the second transaction using the metadata change lock, wherein the modification is not blocked by the metadata access lock; and
committing the second transaction at a time T6,
wherein said time T2 is subsequent to said time T1, said time T5 is subsequent to said time T2, said time T3 is subsequent to said time T5, and said time T6 is subsequent to said time T3.

### Claim 16

(canceled)

### Claim 17 (depends on 15)

The computer program product of claim 15, wherein prior to executing the metadata modification command, the metadata object comprises a first version of the metadata object.

### Claim 18 (depends on 17)

The computer program product of claim 17 wherein executing the metadata modification command causes the first version of the metadata object to be modified into a second version of the metadata object.

### Claim 19 (depends on 18)

The computer program product of claim 18, the operations further comprising operating the relational database system in a first snapshot isolation mode and:
executing the second query inside the first transaction at a time prior to T6 causing a second query plan to be compiled, wherein the second query plan references the first version of the metadata object; and
executing the second query a second time inside the first transaction at a time subsequent to said time T6 causing the second query plan to be recompiled to generate a third query plan, wherein the third query plan references the second version of the metadata object.

### Claim 20 (depends on 18)

The computer program product of claim 18, the operations further comprising operating the relational database system in the second snapshot isolation mode and executing the second query inside the first transaction at a time either prior to or subsequent to said time T6 causing a second query plan to be compiled wherein the second query plan references the first version of the metadata object.

### Claim 21 (depends on 12)

The method of claim 12, further comprising:
determining which of the first version or the second version of the metadata object is visible to a transaction at a predetermined time.

### Claim 22 (depends on 14)

The method of claim 14, further comprising:
determining which of the first version or the second version of the metadata object is visible to a transaction at a predetermined time based at least in part on whether the program code is configured to operate in the first snapshot isolation mode, the second snapshot isolation mode or a non-snapshot isolation mode.
