IP Library › Granted Patent US 12,189,627
Granted Patent B2
US 12,189,627 · App. 17/931,588 · Granted Jan 7, 2025

Query optimization using reinforcement learning

Inventors: Thomas A. Beavin (Milpitas, CA); Shuanglin Guo (Cupertino, CN); Brandon Jabr (Los Altos, CA); Terence P. Purcell (Springfield, IL)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F16/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,189,627
App. No.
17/931,588
Granted
Jan 7, 2025
Kind
B2
Abstract

According to an aspect, a computer-implemented method for improving query performance in a databased management system (DBMS) includes receiving, by a query optimizer of the DMBS, a query for execution. The method also includes creating, by the query optimizer, an initial access path for the query based on state and executing the query based on the initial access path. The method further includes observing, by a query agent of the DBMS, the execution of the query and modifying at least one of the state based on a determination by the query agent that a change to the initial access path would improve the execution of the query.

Claims (52)

1. A computer-implemented method to improve query performance in a database management system (DBMS), the method comprising:

receiving, by a query optimizer of the DMBS, a query for execution;

creating, by the query optimizer, an initial access path for the query based on a current state of a database of the DBMS;

executing the query based on the initial access path;

observing, by a query agent of the DBMS, the execution of the query, wherein the query agent analyzes the current state and based on the current state, determines a rewarding action from a set of actions to determine a change to the initial access path for the query;

based on a determination by the query agent that the change to the initial access path would improve the execution of the query, modifying the current state,

wherein the determination by the query agent that the change to the initial access path would improve the execution of the query is based on the query agent performing the query according to a second access path that is different from the initial access path.

2. The computer-implemented method of claim 1 , wherein the modifying at least one of the state causes the query optimizer to create an access path different from the initial access path for a subsequent execution of the query.

3. The computer-implemented method of claim 1 , wherein the modifications to the at least one of the state are determined based on the second access path.

4. The computer-implemented method of claim 1 , further comprising:

calculating an improvement score based on a difference between the execution of the query based on the initial access path and the execution of the query based on the second access path.

5. The computer-implemented method of claim 4 , wherein the determination that the change to the initial access path would improve the execution of the query is based on the improvement score exceeding a threshold value.

6. The computer-implemented method of claim 1 , further comprising:

receiving, by the query optimizer of the DMBS, a second query for execution;

creating, by the query optimizer, an access path for the second query based on the modified state;

executing, by the DMBS, the query based on the access path;

observing, by the query agent of the DBMS, the execution of the second query;

based on a determination by the query agent that a change to the access path would improve the execution of the query, modifying at least one of the modified state.

7. A system comprising:

a memory having computer readable instructions; and

one or more processors for executing the computer readable instructions, the computer readable instructions controlling the one or more processors to perform operations comprising:

receiving, by a query optimizer of a database management system (DBMS), a query for execution;

creating, by the query optimizer, an initial access path for the query based on a current state of a database of the DBMS;

executing the query based on the initial access path;

observing, by a query agent of the DBMS, the execution of the query, wherein the query agent analyzes the current state and based on the current state, determines a rewarding action from a set of actions to determine a change to the initial access path for the query;

based on a determination by the query agent that the change to the initial access path would improve the execution of the query, modifying the current state,

wherein the determination by the query agent that the change to the initial access path would improve the execution of the query is based on the query agent performing the query according to a second access path that is different from the initial access path.

8. The system of claim 7 , wherein the modifying at least one of the state causes the query optimizer to create an access path different from the initial access path for a subsequent execution of the query.

9. The system of claim 7 , wherein the modifications to the at least one of the state are determined based on the second access path.

10. The system of claim 7 , wherein the operations further comprise:

calculating an improvement score based on a difference between the execution of the query based on the initial access path and the execution of the query based on the second access path.

11. The system of claim 10 , wherein the determination that the change to the initial access path would improve the execution of the query is based on the improvement score exceeding a threshold value.

12. The system of claim 7 , wherein the operations further comprise:

receiving, by the query optimizer of the DMBS, a second query for execution;

creating, by the query optimizer, an access path for the second query based on the modified state;

executing, by the DMBS, the query based on the access path;

observing, by the query agent of the DBMS, the execution of the second query;

based on a determination by the query agent that a change to the access path would improve the execution of the query, modifying at least one of the modified state.

13. A computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform operations comprising:

receiving, by a query optimizer of a database management system (DBMS), a query for execution;

creating, by the query optimizer, an initial access path for the query based on a current state of a database of the DBMS;

executing the query based on the initial access path;

observing, by a query agent of the DBMS, the execution of the query, wherein the query agent analyzes the current state and based on the current state, determines a rewarding action from a set of actions to determine a change to the initial access path for the query;

based on a determination by the query agent that a change to the initial access path would improve the execution of the query, modifying the current state,

wherein the determination by the query agent that the change to the initial access path would improve the execution of the query is based on the query agent performing the query according to a second access path that is different from the initial access path.

14. The computer program product of claim 13 , wherein the modifying at least one of the state causes the query optimizer to create an access path different from the initial access path for a subsequent execution of the query.

15. The computer program product of claim 13 , wherein the operations further comprise:

receiving, by the query optimizer of the DMBS, a second query for execution;

creating, by the query optimizer, an access path for the second query based on the modified state;

executing, by the DMBS, the query based on the access path;

observing, by the query agent of the DBMS, the execution of the second query;

based on a determination by the query agent that a change to the access path would improve the execution of the query, modifying at least one of the modified state.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 13, 2022
From: BEAVIN, THOMAS A.; GUO, SHUANGLIN; JABR, BRANDON; PURCELL, TERENCE P.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 061074/0598 →
Continuity (2)
Provisional Application 63366070 · Jun 9, 2022
Related Publication 20230401207A1 · Dec 14, 2023
References Cited (15)
US 6763359B2 · Lohman et al. · 2004 [cited by applicant]
US 7610264B2 · Ewen et al. · 2009 [cited by applicant]
US 8788660B2 · Barsness et al. · 2014 [cited by applicant]
US 11531657B1 · Sankaran · 2022 [cited by examiner]
US 20090271360A1 · Bestgen et al. · 2009 [cited by applicant]
US 20130013586A1 · Muras et al. · 2013 [cited by applicant]
US 20190354621A1 · Wang · 2019 [cited by examiner]
US 20210133193A1 · Mcconnell · 2021 [cited by applicant]
US 20220067046A1 · Katroulis · 2022 [cited by examiner]
US 20230177053A1 · Interlandi · 2023 [cited by examiner]
US 20230315702A1 · Wu · 2023 [cited by examiner]
CN 111444220A · 2020 [cited by applicant]
CN 112988802A · 2022 [cited by applicant]
GB 2478016A · 2011 [cited by applicant]
Marcus, Ryan & Olga Papaemmanouil, “Deep Reinforcement Learning for Join Order Enumeration”, ACM 'aiDM '18, Jun. 2018, 4 pages. (Year: 2018). [cited by examiner]