Selecting from OR-expansion states of a query
First Claim
1. A method comprising:
- accessing a query comprising a plurality of predicates that includes two or more predicates in disjunction;
selecting, based on a number of predicates in said two or more predicates in disjunction, from a plurality of alternative stored procedures, a certain procedure to expand the query into one or more semantically equivalent candidate queries;
wherein the plurality of alternative stored procedures each generate a different set of semantically equivalent candidate queries from an expansion state space of the query that includes all possible semantically equivalent queries comprising two or more conjunctive subqueries combined by one or more UNION ALL operators, each conjunctive subquery of the two or more conjunctive subqueries including one or more predicates of the plurality of predicates, in conjunction, said two or more conjunctive subqueries include a first conjunctive query that includes a particular predicate of said two or more predicates and a second conjunctive subquery that includes another of said two or more predicate but not said particular predicate;
based on the certain procedure selected, generating one or more semantically equivalent candidate queries;
performing a cost evaluation of the query and each of the one or more semantically equivalent candidate queries;
based at least in part on the cost evaluation, selecting a particular query of the one or more semantically equivalent candidate queries or the query;
causing execution of a transformed query that is based at least in part on the particular query;
wherein the method is performed by one or more processors of one or more computing devices.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods, stored instructions, and computer systems are described for selecting an OR-expansion state of a query. A query processor accesses a certain query and a control parameter. The certain query comprises disjunctive predicates, and the control parameter indicates a certain procedure of a plurality of alternative stored procedures for expanding queries comprising disjunctive predicates into semantically equivalent candidate queries comprising combinations of subqueries. Based at least in part on the control parameter, the query processor selects the certain procedure to expand the certain query into one or more certain semantically equivalent candidate queries, each comprising a different combination of two or more subqueries. The query processor causes cost-based evaluation of subject queries, including the certain query and the one or more certain semantically equivalent candidate queries. The query processor then selects a query of the subject queries for execution or for further evaluation or transformation.
114 Citations
28 Claims
-
1. A method comprising:
-
accessing a query comprising a plurality of predicates that includes two or more predicates in disjunction; selecting, based on a number of predicates in said two or more predicates in disjunction, from a plurality of alternative stored procedures, a certain procedure to expand the query into one or more semantically equivalent candidate queries; wherein the plurality of alternative stored procedures each generate a different set of semantically equivalent candidate queries from an expansion state space of the query that includes all possible semantically equivalent queries comprising two or more conjunctive subqueries combined by one or more UNION ALL operators, each conjunctive subquery of the two or more conjunctive subqueries including one or more predicates of the plurality of predicates, in conjunction, said two or more conjunctive subqueries include a first conjunctive query that includes a particular predicate of said two or more predicates and a second conjunctive subquery that includes another of said two or more predicate but not said particular predicate; based on the certain procedure selected, generating one or more semantically equivalent candidate queries; performing a cost evaluation of the query and each of the one or more semantically equivalent candidate queries; based at least in part on the cost evaluation, selecting a particular query of the one or more semantically equivalent candidate queries or the query; causing execution of a transformed query that is based at least in part on the particular query; wherein the method is performed by one or more processors of one or more computing devices. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. One or more non-transitory computer-readable storage media storing instructions which, when executed, cause:
-
accessing a query comprising a plurality of predicates that includes two or more predicates, in disjunction; selecting, based on a number of predicates in said two or more predicates in disjunction, from a plurality of alternative stored procedures, a certain procedure to expand the query into one or more semantically equivalent candidate queries; wherein the plurality of alternative stored procedures each generate a different set of semantically equivalent candidate queries from an expansion state space of the query that includes all possible semantically equivalent queries comprising two or more conjunctive subqueries combined by one or more UNION ALL operators, each conjunctive subquery of the two or more conjunctive subqueries including one or more predicates of the plurality of predicates, in conjunction, said two or more conjunctive subqueries include a first conjunctive query that includes a particular predicate of said two or more predicates and a second conjunctive subquery that includes another of said two or more predicate but not said particular predicate; based on the certain procedure selected, generating one or more semantically equivalent candidate queries; performing a cost evaluation of the query and each of the one or more semantically equivalent candidate queries; based at least in part on the cost evaluation, selecting a particular query of the one or more semantically equivalent candidate queries or the query; causing execution of a transformed query that is based at least in part on the particular query. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28)
-
Specification