System and method for forcing a query execution plan
First Claim
Patent Images
1. A method for forcing a query execution plan, the method comprising:
- receiving a suggested execution plan;
generating a hint tree that is a structural representation of the suggested execution plan;
generating a plurality of execution plans; and
performing a guided query optimization in which execution plans that do not match the suggested execution plan are eliminated as candidates such that the guided query optimization generates a resulting execution plan that matches the suggested execution plan or a determination that the suggested execution plan is invalid, guided query optimization comprising(a) setting a parent node to be a root node of an execution plan tree;
(b) generating a possible set of child nodes of the parent node;
(c) comparing the possible set of child nodes to a corresponding set of child nodes in the hint tree, and(d) if the possible set of child nodes does not match the corresponding set of child nodes in the hint tree, then;
if there is another possible set of child nodes, then returning to step (b);
if there is no other possible set of child nodes, then determining that the hint tree is invalid;
(e) if the set of possible child nodes matches the corresponding set of child nodes in the hint tree, then;
if there is a remaining non-leaf node in the execution plan tree, then setting the parent node to be the remaining non-leaf node and returning to step (b); and
if there is no remaining non-leaf node in the execution plan tree, then generating the resulting execution plan in accordance with the execution plan tree in its current form.
2 Assignments
0 Petitions
Accused Products
Abstract
A suggested query execution plan is used as a constraint on a guided optimization process such that all execution plans that do not conform to the suggested execution plan are eliminated as possible alternatives. If the guided optimization process successfully generates a resulting execution plan, then the result will conform to the suggested execution plan. If the guided optimization process fails to generate a resulting execution plan, then it may be determined that the suggested execution plan is invalid.
-
Citations
16 Claims
-
1. A method for forcing a query execution plan, the method comprising:
-
receiving a suggested execution plan; generating a hint tree that is a structural representation of the suggested execution plan; generating a plurality of execution plans; and performing a guided query optimization in which execution plans that do not match the suggested execution plan are eliminated as candidates such that the guided query optimization generates a resulting execution plan that matches the suggested execution plan or a determination that the suggested execution plan is invalid, guided query optimization comprising (a) setting a parent node to be a root node of an execution plan tree; (b) generating a possible set of child nodes of the parent node; (c) comparing the possible set of child nodes to a corresponding set of child nodes in the hint tree, and (d) if the possible set of child nodes does not match the corresponding set of child nodes in the hint tree, then; if there is another possible set of child nodes, then returning to step (b); if there is no other possible set of child nodes, then determining that the hint tree is invalid; (e) if the set of possible child nodes matches the corresponding set of child nodes in the hint tree, then; if there is a remaining non-leaf node in the execution plan tree, then setting the parent node to be the remaining non-leaf node and returning to step (b); and if there is no remaining non-leaf node in the execution plan tree, then generating the resulting execution plan in accordance with the execution plan tree in its current form. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer readable storage medium storing computer executable instructions for performing the following steps comprising:
-
receiving a suggested execution plan; generating a hint tree that is a structural representation of the suggested execution plan; generating a plurality of execution plans; and performing a guided query optimization in which execution plans that do not match the suggested execution plan are eliminated as candidates such that the guided query optimization generates a resulting execution plan that matches the suggested execution plan or a determination that the suggested execution plan is invalid, guided query optimization comprising (a) setting a parent node to be a root node of an execution plan tree; (b) generating a possible set of child nodes of the parent node; (c) comparing the possible set of child nodes to a corresponding set of child nodes in the hint tree, and (d) if the possible set of child nodes does not match the corresponding set of child nodes in the hint tree, then; if there is another possible set of child nodes, then returning to step (b); if there is no other possible set of child nodes, then determining that the hint tree is invalid; (e) if the set of possible child nodes matches the corresponding set of child nodes in the hint tree, then; if there is a remaining non-leaf node in the execution plan tree, then setting the parent node to be the remaining non-leaf node and returning to step (b); and if there is no remaining non-leaf node in the execution plan tree, then generating the resulting execution plan in accordance with the execution plan tree in its current form. - View Dependent Claims (7, 8, 9, 10)
-
-
11. A system for forcing a query execution plan, the system comprising
a processor operative to execute computer executable instructions, and memory having stored therein computer executable instructions for performing the following steps: -
receiving a suggested execution plan; generating a hint tree that is a structural representation of the suggested execution plan; generating a plurality of execution plans; and performing a guided query optimization in which execution plans that do not match the suggested execution plan are eliminated as candidates such that the guided query optimization generates a resulting execution plan that matches the suggested execution plan or a determination that the suggested execution plan is invalid, guided query optimization comprising (a) setting a parent node to be a root node of an execution plan tree; (b) generating a possible set of child nodes of the parent node; (c) comparing the possible set of child nodes to a corresponding set of child nodes in the hint tree, and (d) if the possible set of child nodes does not match the corresponding set of child nodes in the hint tree, then; if there is another possible set of child nodes, then returning to step (b); if there is no other possible set of child nodes, then determining that the hint tree is invalid; (e) if the set of possible child nodes matches the corresponding set of child nodes in the hint tree, then; if there is a remaining non-leaf node in the execution plan tree, then setting the parent node to be the remaining non-leaf node and returning to step (b); and if there is no remaining non-leaf node in the execution plan tree, then generating the resulting execution plan in accordance with the execution plan tree in its current form. - View Dependent Claims (12, 13, 14, 15, 16)
-
Specification