IP Library Granted Patent US 12,541,503
Granted Patent B2
US 12,541,503 · App. 18/428,887 · Granted Feb 3, 2026

Schema snapshot isolation access in a relational database

Inventors: Noah Amin Al-Shihabi (Seattle, WA); Panagiotis Antonopoulos (Redmond, WA); Hanumantha Rao Kodavalla (Sammamish, WA); Nikolas Christopher Ogg (Seattle, WA); Divyesh Rameshchandra Tikmani (Telangana, IN); Wonseok Kim (Sammamish, WA); Alexander Wai-man Swanson (Redmond, WA); Rajat Jain (Redmond, WA)
Assignee: MICROSOFT TECHNOLOGY LICENSING, LLC
G06F16/2379G06F16/2343G06F16/24542
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 12,541,503
App. No.
18/428,887
Granted
Feb 3, 2026
Kind
B2
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 (81)

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 single 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 single 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:

execute the metadata modification command to:

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 said modify is not blocked by the metadata access lock; and

commit 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.

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

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

4 . The relational database system of claim 3 , 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.

5 . The relational database system of claim 3 , 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.

6 . 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.

7 . The relational database system of claim 6 , 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 read committed snapshot isolation mode, the regular snapshot isolation mode, or a non-snapshot isolation mode.

8 . 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:

executing the metadata modification command by:

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 said modifying 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.

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

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

11 . The method of claim 10 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.

12 . The method of claim 11 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.

13 . The method of claim 10 , 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.

14 . 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 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.

15 . A computer program product comprising a computer-readable medium 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:

executing the metadata modification command by:

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 said modifying 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.

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

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

18 . The computer program product of claim 17 , 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.

19 . The computer program product of claim 18 , the operations further comprising 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.

20 . The computer program product of claim 19 , the operations 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.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 20, 2024
From: AL-SHIHABI, NOAH AMIN; ANTONOPOULOS, PANAGIOTIS; KODAVALLA, HANUMANTHA RAO; OGG, NIKOLAS CHRISTOPHER; TIKMANI, DIVYESH RAMESHCHANDRA; KIM, WONSEOK; SWANSON, ALEXANDER WAI-MAN; JAIN, RAJAT
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 066840/0104 →
Continuity (2)
Provisional Application 63598826 · Nov 14, 2023
Related Publication 20250156400A1 · May 15, 2025
References Cited (13)
US 7644106B2 · Shankar · 2010 [cited by examiner]
US 8688703B1 · Antova · 2014 [cited by examiner]
US 10977227B2 · Lee · 2021 [cited by examiner]
US 20110302143A1 · Lomet · 2011 [cited by examiner]
US 20110313999A1 · Bruno · 2011 [cited by examiner]
US 20180011895A1 · Johnson · 2018 [cited by examiner]
US 20180121494A1 · Antonopoulos · 2018 [cited by examiner]
US 20220300483A1 · Singh · 2022 [cited by examiner]
US 20220414081A1 · Ravella · 2022 [cited by examiner]
Ghanayem, et al., “Create View (Transact-SQL)”, Retrieved from: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-view-transact-sql?view=sql-server-ver15#remarks, May 23, 2023, 17 Pages. [cited by applicant]
To, et al., “Table Hints (Transact-SQL)”, Retrieved from: https://learn.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table?view=sql-server-ver15, Oct. 4, 2023, 20 Pages. [cited by applicant]
International Search Report and Written Opinion received for PCT Application No. PCT/US2024/052169, Feb. 17, 2025, 13 Pages. [cited by applicant]
Tianxun, et al., “Online Schema Evolution is (Almost) Free for Snapshot Databases”, In Repository of arXiv preprint, Oct. 8, 2022, 14 Pages. [cited by applicant]