IP Library Granted Patent US 11,080,278
Granted Patent B2
US 11,080,278 · App. 16/888,526 · Granted Aug 3, 2021

Database query plan selection

Inventor: Mengmeng Chen (Hangzhou, CN)
Assignee: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
G06F16/24542G06F16/2282G06F16/24524G06F16/24539G06K9/6215
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 11,080,278
App. No.
16/888,526
Granted
Aug 3, 2021
Kind
B2
Abstract

A computer-implemented database access method includes receiving, by a server, a database access statement including a target identifying parameter; parsing the database access statement to determine the target identifying parameter; determining a statement type of the database access statement; obtaining a pre-stored execution plan group corresponding to the statement type, the pre-stored execution plan group including one or more execution plans for accessing a database corresponding to the database access statement, in which each execution plan corresponds to a different respective identifying parameter; selecting a target execution plan from the pre-stored execution plan group based on the target identifying parameter; and executing the target execution plan.

Claims (77)

1. A computer-implemented database access method, comprising:

receiving a database access statement comprising a target identifying parameter and one or more objects;

for a first object of the one or more objects, determining that an object pattern of the first object matches respective object patterns of one or more second objects, the one or more second objects belonging to a first object type group to which the first object belongs;

in response to determining than the object pattern of the first object matches the respective object patterns of the one or more second objects, calculating respective similarities between the first object and each second object of the one or more second objects, in which higher similarities correspond to more closely matching attributes between objects;

determining that each similarity of the respective similarities is less than a predetermined threshold;

in response to determining that each similarity of the respective similarities is less than the predetermined threshold, determining a second object type group to which the first object belongs;

parsing the database access statement to determine the target identifying parameter;

parameterizing the database access statement to obtain a parameterized database access statement, wherein parameterizing the database access statement comprises replacing at least one object of the one or more objects with an object group parameter based on an object type group to which the at least one object belongs;

determining a statement type of the database access statement based on the parameterized database access statement;

selecting a pre-stored execution plan group corresponding to the statement type, wherein the pre-stored execution plan group comprises one or more execution plans for accessing a database corresponding to the database access statement, and wherein the one or more execution plans comprise a target execution plan;

selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter; and

executing the target execution plan.

2. The computer-implemented method of claim 1 , wherein replacing the at least one object of the one or more objects with the object group parameter comprises:

extracting the one or more objects from the database access statement;

determining the object type group to which the at least one object of the one or more objects belongs; and

replacing, in the database access statement, the at least one object with the object group parameter, wherein the object group parameter corresponds to the object type group to which the at least one object belongs.

3. The computer-implemented method of claim 1 , wherein parameterizing the database access statement comprises replacing, in the database access statement, the target identifying parameter with a wildcard.

4. The computer-implemented method of claim 2 , comprising determining a third object type group, wherein determining the third object type group comprises:

selecting multiple objects from the database, the multiple objects having a matching object pattern;

grouping the multiple objects into the third object type group; and

establishing a mapping relationship between the multiple objects and the third object type group.

5. The computer-implemented method of claim 1 , wherein the one or more objects comprise a table of the database.

6. The computer-implemented method of claim 5 , wherein the one or more objects are grouped into one or more object type groups based on respective table parameters of the one or more objects.

7. The computer-implemented method of claim 1 , wherein selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter comprises:

calculating respective Euclidean distances between the target identifying parameter and one or more other identifying parameters corresponding to one or more other execution plans in the pre-stored execution plan group; and

selecting, as the target execution plan, an execution plan corresponding to a Euclidean distance that is less than a distance threshold.

8. A non-transitory, computer-readable medium storing one or more instructions that, when executed by a computer system, cause the computer system to perform database access operations comprising:

receiving a database access statement comprising a target identifying parameter and one or more objects;

for a first object of the one or more objects, determining that an object pattern of the first object matches respective object patterns of one or more second objects, the one or more second objects belonging to a first object type group to which the first object belongs;

in response to determining than the object pattern of the first object matches the respective object patterns of the one or more second objects, calculating respective similarities between the first object and each second object of the one or more second objects, in which higher similarities correspond to more closely matching attributes between objects;

determining that each similarity of the respective similarities is less than a predetermined threshold;

in response to determining that each similarity of the respective similarities is less than the predetermined threshold, determining a second object type group to which the first object belongs;

parsing the database access statement to determine the target identifying parameter;

parameterizing the database access statement to obtain a parameterized database access statement, wherein parameterizing the database access statement comprises replacing at least one object of the one or more objects with an object group parameter based on an object type group to which the at least one object belongs;

determining a statement type of the database access statement based on the parameterized database access statement;

selecting a pre-stored execution plan group corresponding to the statement type, wherein the pre-stored execution plan group comprises one or more execution plans for accessing a database corresponding to the database access statement, and wherein the one or more execution plans comprise a target execution plan;

selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter; and

executing the target execution plan.

9. The non-transitory, computer-readable medium of claim 8 , wherein replacing the at least one object of the one or more objects with the object group parameter comprises:

extracting the one or more objects from the database access statement;

determining the object type group to which the at least one object of the one or more objects belongs; and

replacing, in the database access statement, the at least one object with the object group parameter, wherein the object group parameter corresponds to the object type group to which the at least one object belongs.

10. The non-transitory, computer-readable medium of claim 8 , wherein parameterizing the database access statement comprises replacing, in the database access statement, the target identifying parameter with a wildcard.

11. The non-transitory, computer-readable medium of claim 9 , wherein the database access operations comprise determining a third object type group, wherein determining the third object type group comprises:

selecting multiple objects from the database, the multiple objects having a matching object pattern;

grouping the multiple objects into the third object type group; and

establishing a mapping relationship between the multiple objects and the third object type group.

12. The non-transitory, computer-readable medium of claim 8 , wherein the one or more objects comprise a table of the database.

13. The non-transitory, computer-readable medium of claim 8 , wherein selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter comprises:

calculating respective Euclidean distances between the target identifying parameter and one or more other identifying parameters corresponding to one or more other execution plans in the pre-stored execution plan group; and

selecting, as the target execution plan, an execution plan corresponding to a Euclidean distance that is less than a distance threshold.

14. A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, cause the one or more computers to perform one or more database access operations comprising:

receiving a database access statement comprising a target identifying parameter and one or more objects;

for a first object of the one or more objects, determining that an object pattern of the first object matches respective object patterns of one or more second objects, the one or more second objects belonging to a first object type group to which the first object belongs;

in response to determining than the object pattern of the first object matches the respective object patterns of the one or more second objects, calculating respective similarities between the first object and each second object of the one or more second objects, in which higher similarities correspond to more closely matching attributes between objects;

determining that each similarity of the respective similarities is less than a predetermined threshold;

in response to determining that each similarity of the respective similarities is less than the predetermined threshold, determining a second object type group to which the first object belongs;

parsing the database access statement to determine the target identifying parameter;

parameterizing the database access statement to obtain a parameterized database access statement, wherein parameterizing the database access statement comprises replacing at least one object of the one or more objects with an object group parameter based on an object type group to which the at least one object belongs;

determining a statement type of the database access statement based on the parameterized database access statement;

selecting a pre-stored execution plan group corresponding to the statement type, wherein the pre-stored execution plan group comprises one or more execution plans for accessing a database corresponding to the database access statement, and wherein the one or more execution plans comprise a target execution plan;

selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter; and

executing the target execution plan.

15. The computer-implemented system of claim 14 , wherein replacing the at least one object of the one or more objects with the object group parameter comprises:

extracting the one or more objects from the database access statement;

determining the object type group to which the at least one object of the one or more objects belongs; and

replacing, in the database access statement, the at least one object with the object group parameter, wherein the object group parameter corresponds to the object type group to which the at least one object belongs.

16. The computer-implemented system of claim 14 , wherein parameterizing the database access statement comprises replacing, in the database access statement, the target identifying parameter with a wildcard.

17. The computer-implemented system of claim 15 , wherein the database access operations comprise determining a third object type group, wherein determining the third object type group comprises:

selecting multiple objects from the database, the multiple objects having a matching object pattern;

grouping the multiple objects into the third object type group; and

establishing a mapping relationship between the multiple objects and the third object type group.

18. The computer-implemented system of claim 14 , wherein selecting the target execution plan from the pre-stored execution plan group based on the target identifying parameter comprises:

calculating respective Euclidean distances between the target identifying parameter and one or more other identifying parameters corresponding to one or more other execution plans in the pre-stored execution plan group; and

selecting, as the target execution plan, an execution plan corresponding to a Euclidean distance that is less than a distance threshold.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2021
From: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
To: BEIJING OCEANBASE TECHNOLOGY CO., LTD.
Reel/Frame 057349/0070 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 11, 2021
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANT FINANCIAL (HANG ZHOU) NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 055237/0137 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 11, 2020
From: CHEN, MENGMENG
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 053458/0216 →