Database query plan selection
AssigneeAnt Financial (Hang Zhou) Network Technology Co., Ltd.
InventorMengmeng Chen
Life of this patent
Estimating the term…
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.
Claims18
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.
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.
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.
Dependencies are inferred from the claim text.