IP Library Granted Patent US 12705243
Granted Patent B2
US 12705243 · App. 18/991,203 · Granted Aug 11, 2026

Plan cache hydration for database systems

Inventors: Smita Behera (Yarrow Point, WA); In-Jerng Choe (Sammamish, WA); Manish Eknath Tawade (Redmond, WA); Johnathan Chow (Redmond, WA); Charles Edward Hennessey (Redmond, WA); Wai Keat Tan (Seattle, WA); Patryk Maciej Uchman (Seattle, WA); Derek Marcel Wilson (Chester, VA); Adrian Dragusanu (Redmond, WA)
Assignee: MICROSOFT TECHNOLOGY LICENSING, LLC
G06F16/24552G06F16/24542G06F16/275
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 12705243
App. No.
18/991,203
Granted
Aug 11, 2026
Kind
B2
Abstract

A computing network provides a database service and implements a caching mechanism for processing database queries. The database services are provided using a primary replica of data and computing resources, and a secondary replica of the data and computing resources. The primary and secondary replicas are synchronized so that the secondary replica can provide the database services in place of the primary replica in response to a failover from the primary replica to the secondary replica. In response to initiating, by the database service, a failover from the primary replica to the secondary replica, the cached plans compiled by the secondary replica are used to process matching query batches by the secondary replica. The secondary replica processes the matching query batches without accessing plans compiled by the primary replica.

Claims (38)

1 . A computer-implemented method for performing query compilation in a computing network providing a database service and implementing a caching mechanism for processing database queries, the method comprising:

capturing, by the database service, query batches from tenants of the computing network, wherein the database service is provided using a primary replica of data and computing resources and a secondary replica of the data and computing resources, wherein the primary and secondary replicas are synchronized so that the secondary replica can provide the database services in place of the primary replica in response to a failover from the primary replica to the secondary replica;

accessing, by the primary and secondary replicas, the captured query batches;

compiling, by the primary and secondary replicas, the captured query batches to generate plans for the captured query batches;

caching, by each of the primary and secondary replicas, the generated plans, wherein the plans are separately cached by each of the primary and secondary replicas, and wherein the plans cached by the secondary replica are persisted; and

in response to initiating, by the database service, a failover from the primary replica to the secondary replica, using the cached plans compiled by the secondary replica to process matching query batches by the secondary replica; wherein the secondary replica processes the matching query batches without accessing plans compiled by the primary replica.

2 . The computer-implemented method of claim 1 , wherein the database service is SQL.

3 . The computer-implemented method of claim 1 , wherein the accessing and compiling is performed by a replay service.

4 . The computer-implemented method of claim 1 , wherein the captured query batches are stored in a persistent store, wherein the stored query batches in the persistent store are accessible by the secondary replica.

5 . The computer-implemented method of claim 1 , wherein the captured query batches are provided to the secondary replica by one of: transferring messages from the primary replica to the secondary replica, or using replication.

6 . The computer-implemented method of claim 1 , wherein the accessing and compiling are performed in response to determining that plans for the captured query batches were not found.

7 . The computer-implemented method of claim 1 , further comprising accessing, by the secondary replica, the captured query batches along with contextual information.

8 . A computing device comprising:

one or more processors;

a memory in communication with the one or more processors, the memory having computer-readable instructions stored thereupon which, when executed by the one or more processors, cause the computing device perform operations comprising:

capturing query batches from tenants of a computing network providing a database service and implementing a caching mechanism for processing database queries, wherein the database services are provided using a primary replica of data and computing resources, and a secondary replica of the data and computing resources, wherein the primary and secondary replicas are synchronized so that the secondary replica can provide the database services in place of the primary replica in response to a failover from the primary replica to the secondary replica;

accessing, by the secondary replica, the captured query batches;

compiling, by the secondary replica, the captured query batches to generate plans for the captured query batches;

caching, by the secondary replica, the generated plans, wherein the plans are separately cached separately from plans generated by the primary replica, and wherein the plans cached by the secondary replica are persisted; and

in response to a failover from the primary replica to the secondary replica, using the cached plans compiled by the secondary replica to process matching query batches by the secondary replica; wherein the secondary replica processes the matching query batches without plans compiled by the primary replica.

9 . The computing device of claim 8 , wherein the database service is SQL.

10 . The computing device of claim 8 , wherein the accessing and compiling is performed by a replay service running in the computing network.

11 . The computing device of claim 8 , wherein the captured query batches are stored in a persistent store, wherein the stored query batches in the persistent store are accessible by the secondary replica.

12 . The computing device of claim 8 , wherein the captured query batches are provided to the secondary replica by one of: transferring messages from the primary replica to the secondary replica, or using replication.

13 . The computing device of claim 8 , wherein the accessing and compiling are performed in response to determining that plans for the captured query batches were not found.

14 . The computing device of claim 8 , further comprising computer-readable instructions stored thereupon which, when executed by the one or more processors, cause the computing device perform operations comprising:

accessing, by the secondary replica, the captured query batches along with contextual information.

15 . A computer-readable storage medium comprising computer-readable instructions stored thereupon which, when executed by one or more processors of a computing device, cause the computing device perform operations comprising:

capturing query batches from tenants of a computing network providing a database service and implementing a caching mechanism for processing database queries, wherein the database services are provided using a primary instance of data and computing resources, and a secondary instance of the data and computing resources, wherein the primary and secondary instances are synchronized so that the secondary instance can provide the database services in place of the primary instance in response to a failover from the primary instance to the secondary instance;

accessing, by the secondary instance, the captured query batches;

compiling, by the secondary instance, the captured query batches to generate plans for the captured query batches;

caching, by the secondary instance, the generated plans, wherein the plans are separately cached separately from plans generated by the primary instance, and wherein the plans cached by the secondary instance are persisted; and

in response to a failover from the primary instance to the secondary instance, using the cached plans compiled by the secondary instance to process matching query batches by the secondary instance; wherein the secondary instance processes the matching query batches without plans compiled by the primary instance.

16 . The computer-readable storage medium of claim 15 , wherein the database service is SQL.

17 . The computer-readable storage medium of claim 15 , wherein the accessing and compiling is performed by a replay service running in the computing network.

18 . The computer-readable storage medium of claim 15 , wherein the captured query batches are stored in a persistent store, wherein the stored query batches in the persistent store are accessible by the secondary instance.

19 . The computer-readable storage medium of claim 15 , wherein the captured query batches are provided to the secondary instance by one of: transferring messages from the primary instance to the secondary instance, or using replication.

20 . The computer-readable storage medium of claim 15 , wherein the accessing and compiling are performed in response to determining that plans for the captured query batches were not found.