IP Library Granted Patent US 12,585,649
Granted Patent B2
US 12,585,649 · App. 18/671,967 · Granted Mar 24, 2026

Conditional branching for a federated graph query plan

Inventors: Anders Tungeland Gjerdrum (Tromso, NO); Johannes Cornelis Draaijer (Tromso, NO)
Assignee: Microsoft Technology Licensing, LLC.
G06F16/24542G06F16/24539G06F16/256
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,585,649
App. No.
18/671,967
Filed
May 22, 2024
Granted
Mar 24, 2026
Kind
B2
Art Unit
2153
USPC
707/718
Abstract

Example solutions for optimizing an initial query execution plan for a federated database includes identifying a group of operations in the initial query execution plan that conform to a recognized pattern including fetching data from a data store. Based on detection of the pattern and of the presence of a condition, an optimized query execution plan is created from the initial query execution plan by replacing the group of operations with a first execution branch and a second execution branch, wherein the optimized query execution plan executes at least one of the first and second execution branches. The first execution branch includes first operations for fetching the data from a first data store and the second execution branch comprise second operations for fetching at least a subset of the data from a second data store.

Claims (93)

1 . A system for optimizing an initial query execution plan for a federated database, the system comprising:

a processor;

a computer-readable storage medium storing instructions that are operative upon execution by the processor to perform a method, the method comprising:

identifying a group of operations in the initial query execution plan that conform to a recognized pattern of operations, the pattern representing fetching data from a data store;

detecting a presence of a condition; and

based on identifying the group of operations and detecting the presence of the condition, creating, from the initial query execution plan, an optimized query execution plan including replacing the group of operations with a new group of operations comprising a first execution branch and a second execution branch, the optimized query execution plan being configured to execute at least one of the first and second execution branches, wherein:

the first execution branch comprises first operations for fetching the data from a first data store; and

the second execution branch comprises second operations for fetching at least a subset of the data from a second data store.

2 . The system of claim 1 , wherein:

the pattern representing fetching the data comprises fetching deterministic data from the data store;

the condition is that the data store is a cache data store;

the first operations comprise operations that fetch the data from the data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the second data store, the second data store being a non-cache data store.

3 . The system of claim 1 , wherein:

the pattern representing fetching the data comprise fetching deterministic data from the data store;

the condition is that a cache data store exists for the data;

the first operations comprise operations that fetch the data from the cache data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the data store.

4 . The system of claim 1 , wherein:

the condition is a determination that an additional data store maintains a copy of the data;

the first operations comprise operations for fetching the data from the data store; and

the second operations, executed only in an event of a failure of the data store, comprise operations for fetching data from the additional data store.

5 . The system of claim 1 , wherein the optimized query execution plan executes the first execution branch only upon a determination that the data store is available.

6 . The system of claim 1 , wherein:

the pattern representing fetching the data comprises fetching first data from a first data store and fetching second data from a second data store;

the condition comprises detection in the initial query execution plan of a computation of an intersection of the first data and the second data;

the optimized query execution plan predicts a size of the first data and a size of the second data, and the second execution branch is executed only when a predicted size of the second data larger than the predicted size of the first data;

the first operations comprise operations for fetching the first data from the first data store; and

the second operations comprise operations for sending the first data and a subplan to the second data store, the subplan causing the second data store to fetch the second data, compute an intersection between the first data and the second data, and return the intersection.

7 . A computerized method for optimizing an initial query execution plan for a federated database, the method comprising:

identifying a group of operations in the initial query execution plan that conform to a recognized pattern of operations, the pattern representing fetching data from a data store;

detecting a presence of a condition; and

based on identifying the group of operations and detecting the presence of the condition, creating, from the initial query execution plan, an optimized query execution plan including replacing the group of operations with a new group of operations comprising a first execution branch and a second execution branch, the optimized query execution plan being configured to execute at least one of the first and second execution branches, wherein:

the first execution branch comprises first operations for fetching the data from a first data store; and

the second execution branch comprises second operations for fetching at least a subset of the data from a second data store.

8 . The method of claim 7 , wherein:

the pattern representing fetching the data comprises fetching deterministic data from the data store;

the condition is that the data store is a cache data store;

the first operations comprise operations that fetch the data from the data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the second data store, the second data store being a non-cache data store.

9 . The method of claim 7 , wherein:

the pattern representing fetching the data comprise fetching deterministic data from the data store;

the condition is that a cache data store exists for the data, the cache data store being the second data store;

the first operations comprise operations that fetch the data from the cache data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the data store.

10 . The method of claim 7 , wherein:

the condition is a determination that an additional data store maintains a copy of the data;

the first operations comprise operations for fetching the data from the data store; and

the second operations, executed only in an event of a failure of the data store, comprise operations for fetching data from the additional data store.

11 . The method of claim 7 , wherein the optimized query execution plan executes the first execution branch only upon a determination that the data store is available.

12 . The method of claim 7 , wherein:

the pattern representing fetching the data comprises fetching first data from a first data store and fetching second data from a second data store;

the condition comprises detection in the initial query execution plan of a computation of an intersection of the first and second data;

the optimized query execution plan predicts a size of the first data and a size of the second data, and the second execution branch is executed only when a predicted size of the second data is larger than the predicted size of the first data;

the first operations comprise operations for fetching the first data from the first data store; and

the second operations comprise operations for sending the first data and a subplan to the second data store, the subplan causing the second data store to fetch the second data, compute an intersection between the first data and the second data, and return the intersection.

13 . The method of claim 7 , further comprising:

generating the initial query execution plan based on a query received from a requester;

forwarding the optimized query execution plan to a runtime;

receiving, from the runtime, results of the query; and

forwarding the results to the requester.

14 . A non-transitory computer storage device having computer-executable instructions stored thereon, which, on execution by a computer, cause the computer to perform operations for optimizing an initial query execution plan for a federated database, the operations comprising:

identifying a group of operations in the initial query execution plan that conform to a recognized pattern of operations, the pattern representing fetching data from a data store;

detecting a presence of a condition; and

based on identifying the group of operations and detecting of the presence of the condition, creating, from the initial query execution plan, an optimized query execution plan including replacing the operations with a new group of operations comprising a first execution branch and a second execution branch, the optimized query execution plan being configured to execute at least one of the first and second execution branches, wherein:

the first execution branch comprises first operations for fetching the data from a first data store; and

the second execution branch comprises second operations for fetching at least a subset of the data from a second data store.

15 . The non-transitory computer storage device of claim 14 , wherein:

the group of operations for fetching the data comprise fetching deterministic data from the data store;

the condition is that the data store is a cache data store;

the first operations comprise operations that fetch the data from the data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the second data store, the second data store being a non-cache data store.

16 . The non-transitory computer storage device of claim 14 , wherein:

the group of operations for fetching the data comprise fetching deterministic data from the data store;

the condition is that a cache data store exists for the data;

the first operations comprise operations that fetch the data from the cache data store; and

the second operations comprise operations executed only when a cache miss results from the first operations, the second operations fetching the data from the data store.

17 . The non-transitory computer storage device of claim 14 , wherein:

the condition is a determination that an additional data store maintains a copy of the data;

the first operations comprise operations for fetching the data from the data store; and

the second operations, executed only in an event of a failure of the data store, comprise operations for fetching data from the additional data store.

18 . The non-transitory computer storage device of claim 14 wherein the optimized query execution plan executes the first execution branch only upon a determination that the data store is available.

19 . The non-transitory computer storage device of claim 14 , wherein:

the pattern representing fetching the data comprises fetching first data from a first data store and fetching second data from a second data store;

the condition comprises detection in the initial query execution plan of a computation of an intersection of the first and second data;

the optimized query execution plan predicts a size of the first data and a size of the second data, and the second execution branch is executed only when a predicted size of the second data larger than the predicted size of the first data;

the first operations comprise operations for fetching the first data from the first data store; and

the second operations comprise operations for sending the first data and a subplan to the second data store, the subplan causing the second data store to fetch the second data, compute an intersection between the first data and the second data, and return the intersection.

20 . The non-transitory computer storage device of claim 14 , wherein the operations further comprise:

generating the initial query execution plan based on a query received from a requester;

forwarding the optimized query execution plan to a runtime;

receiving, from the runtime, results of the query; and

forwarding the results to the requester.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 22, 2024
From: GJERDRUM, ANDERS TUNGELAND; DRAAIJER, JOHANNES CORNELIS
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 067500/0001 →
Continuity (1)
Related Publication 20250363110A1 · Nov 27, 2025
References Cited (21)
US 8626744B2 · Cheng · 2014 [cited by applicant]
US 9292570B2 · Sargeant · 2016 [cited by applicant]
US 10303567B2 · Finnerty · 2019 [cited by examiner]
US 11321317B2 · Su · 2022 [cited by applicant]
US 11321330B1 · Pandis · 2022 [cited by examiner]
US 11416486B2 · Arnold · 2022 [cited by applicant]
US 20040249683A1 · Demarcken · 2004 [cited by examiner]
US 20070226186A1 · Ewen · 2007 [cited by applicant]
US 20110072006A1 · Yu · 2011 [cited by examiner]
US 20130086039A1 · Salch · 2013 [cited by examiner]
US 20150026692A1 · Ghosh · 2015 [cited by applicant]
US 20160364447A1 · Chen · 2016 [cited by examiner]
US 20180024928A1 · Hassan · 2018 [cited by examiner]
US 20190065549A1 · Pang · 2019 [cited by examiner]
US 20220004551A1 · Ghazal · 2022 [cited by examiner]
US 20230195729A1 · Sebastian · 2023 [cited by applicant]
Abdelaziz, et al., “Query Optimizations Over Decentralized RDF Graphs”, In IEEE 33rd International Conference on Data Engineering, 2017, 4 pages. [cited by applicant]
Bowman, Andrew., “Conditional Cypher Execution”, accessed on link https://neo4j.com/developer/kb/conditional-cypher-execution/, Retrieved on Apr. 11, 2024, 9 pages. [cited by applicant]
Hose, et al., “Database Foundation to Scalable RDF Processing”, Reasoning Web. Semantic Technologies for the Web of Data, Aug. 23, 2011, pp. 202-249. [cited by applicant]
International Search Report and Written Opinion recieved for PCT Application No. PCT/US2025/017113, mailed on May 8, 2025. 13 pages. [cited by applicant]
Zhao, et al., “QueryFormer: A Tree Transformer Model for Query Plan Representation.” Proceedings of the VLDB Endowment, vol. 15, Issue No. 8, Apr. 1, 2022, pp. 1658-1670. [cited by applicant]