Delaying evaluation of expensive expressions in a query
First Claim
1. A computer-implemented method of generating an execution plan for a query, comprising:
- establishing an expensive expression in the query;
wherein establishing the expensive expression includes one or more of;
referencing cost information for the expensive expression in an execution plan; and
looking up a list of known expensive expressions for a match with the expensive expression;
generating a first execution plan for the query in which an operation evaluating the expensive expression occurs no later than a non-empty set of operations that do not evaluate the expensive expression;
generating one or more equivalent execution plans for the query, wherein generating the one or more equivalent execution plans includes generating, in response to said establishing the expensive expression in the query, an execution plan in which the operation evaluating the expensive expression occurs after the non-empty set of operations not evaluating the expensive expression; and
choosing, based on a set of criteria, a particular execution plan from the first execution plan and the one or more equivalent execution plans;
wherein the method is performed by one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
Techniques are provided for delaying evaluation of expensive expressions in a query. Expensive expressions in the query are established by cost information or by looking up a list of known expensive expressions for a match. After an execution plan is determined by using the early evaluation technique, one or more equivalent execution plans is established. The one or more equivalent execution plans may include both a type of execution plans that delay evaluation of expensive expressions and a type of execution plans that do not. In addition, the one or more equivalent execution plans may include both parallelized and non-parallelized alternatives to the execution plan identified by the early evaluation technique. Finally, based on a set of criteria, which may include comparing cost information among all the equivalent execution plans generated thus far, the best execution plan is chosen for the query.
118 Citations
18 Claims
-
1. A computer-implemented method of generating an execution plan for a query, comprising:
-
establishing an expensive expression in the query; wherein establishing the expensive expression includes one or more of; referencing cost information for the expensive expression in an execution plan; and looking up a list of known expensive expressions for a match with the expensive expression; generating a first execution plan for the query in which an operation evaluating the expensive expression occurs no later than a non-empty set of operations that do not evaluate the expensive expression; generating one or more equivalent execution plans for the query, wherein generating the one or more equivalent execution plans includes generating, in response to said establishing the expensive expression in the query, an execution plan in which the operation evaluating the expensive expression occurs after the non-empty set of operations not evaluating the expensive expression; and choosing, based on a set of criteria, a particular execution plan from the first execution plan and the one or more equivalent execution plans; wherein the method is performed by one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A machine-readable non-transitory medium storing one or more sequences of instructions for generating an execution plan for a query which instructions, when executed by one or more processors, cause performance of steps comprising:
-
establishing an expensive expression in the query; wherein establishing the expensive expression includes one or more of; referencing cost information for the expensive expression in an execution plan; and looking up a list of known expensive expressions for a match with the expensive expression; generating a first execution plan for the query in which an operation evaluating the expensive expression occurs no later than a non-empty set of operations that do not evaluate the expensive expression; generating one or more equivalent execution plans for the query, wherein generating the one or more equivalent execution plans includes generating, in response to said establishing the expensive expression in the query, an execution plan in which the operation evaluating the expensive expression occurs after the non- empty set of operations not evaluating the expensive expression; and choosing, based on a set of criteria, a particular execution plan from the first execution plan and the one or more equivalent execution plans. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
Specification