Exploiting partitioning, grouping, and sorting in query optimization
First Claim
1. One or more hardware memory devices, not being a signal per se, storing computer-useable instructions that, when used by one or more computing devices, cause the one or more computing devices to perform a method comprising:
- receiving an input query expression and a set of one or more physical property requirements, the input query expression being represented as an operator tree comprising a plurality of logical operators;
performing logical exploration by applying transformation rules to generate a plurality of logical query expressions with varying logical operators;
performing physical optimization for each logical query expression by applying implementation rules to convert logical operators to physical operatorswherein physical optimization comprises;
for each physical operator considered for each logical operator, determining delivered structural properties output by the physical operator, the delivered structural properties including a partitioning property, a sorting property, and a grouping property, each defining a partition, sort, and group structure, respectively, of output data delivered from the physical operator;
for each physical operator considered for each logical operator, determining required structural properties as input for the physical operator, the required structural properties including a partitioning property, a sorting property, and a grouping property, each defining a partition, sort, and group structure, respectively, of input data required for the physical operator;
determining whether delivered structural properties satisfy corresponding required structural properties, wherein determining whether delivered structural properties satisfy corresponding required structural properties comprises;
(a) determining whether delivered partitioning properties satisfy required partitioning properties;
(b) determining whether delivered sorting properties satisfy required sorting properties; and
(c) determining whether delivered grouping properties satisfy required grouping properties;
identifying valid execution plans in which delivered structural properties satisfy required structural properties;
estimating costs associated with each of the valid execution plans; and
selecting, from the valid execution plans, an execution plan having a lowest cost as an optimized execution plan.
2 Assignments
0 Petitions
Accused Products
Abstract
An optimizer uses comprehensive reasoning regarding partitioning, sorting, and grouping properties for query optimization. When optimizing an input query expression, logical exploration generates alternative logical expressions. Physical optimization explores physical operator alternatives for logical operators. Required partitioning, sorting, and grouping properties of inputs to physical operators are determined. Additionally, delivered partitioning, sorting, and grouping properties of outputs from physical operators are determined. In some embodiments, enforcer rules are employed to modify structural property requirements to introduce alternatives for consideration. Property matching identifies valid execution plans in which the delivered partitioning, sorting, and grouping properties satisfy corresponding required partitioning, sorting, and grouping properties. An execution plan having the lowest cost is selected as the optimized execution plan.
37 Citations
20 Claims
-
1. One or more hardware memory devices, not being a signal per se, storing computer-useable instructions that, when used by one or more computing devices, cause the one or more computing devices to perform a method comprising:
-
receiving an input query expression and a set of one or more physical property requirements, the input query expression being represented as an operator tree comprising a plurality of logical operators; performing logical exploration by applying transformation rules to generate a plurality of logical query expressions with varying logical operators; performing physical optimization for each logical query expression by applying implementation rules to convert logical operators to physical operators wherein physical optimization comprises; for each physical operator considered for each logical operator, determining delivered structural properties output by the physical operator, the delivered structural properties including a partitioning property, a sorting property, and a grouping property, each defining a partition, sort, and group structure, respectively, of output data delivered from the physical operator; for each physical operator considered for each logical operator, determining required structural properties as input for the physical operator, the required structural properties including a partitioning property, a sorting property, and a grouping property, each defining a partition, sort, and group structure, respectively, of input data required for the physical operator; determining whether delivered structural properties satisfy corresponding required structural properties, wherein determining whether delivered structural properties satisfy corresponding required structural properties comprises; (a) determining whether delivered partitioning properties satisfy required partitioning properties; (b) determining whether delivered sorting properties satisfy required sorting properties; and (c) determining whether delivered grouping properties satisfy required grouping properties; identifying valid execution plans in which delivered structural properties satisfy required structural properties; estimating costs associated with each of the valid execution plans; and selecting, from the valid execution plans, an execution plan having a lowest cost as an optimized execution plan. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. One or more hardware memory devices, not being a signal per se, storing software components useable by one or more computing devices to provide query optimization, the software components comprising:
-
a required properties component for determining required structural properties for physical operators being considered during query optimization, the required structural properties including structural property requirements of inputs to the physical operators, the required structural properties including partitioning properties, grouping properties, and sorting properties, each defining the partition, sort, and group structure, respectively, of input data required from physical operators; a delivered properties component for determining delivered structural properties for the physical operators, the delivered structural properties including structural properties of outputs from the physical operators, the delivered structural properties including partitioning properties, grouping properties, and sorting properties, each defining the partition, sort, and group structure, respectively, of output data delivered from physical operator; and a property matching component for determining whether delivered structural properties satisfy required structural properties to identify one or more valid execution plans, determining whether delivered structural properties satisfy required structural properties, wherein determining whether delivered structural properties satisfy corresponding required structural properties comprises; (a) determining whether delivered partitioning properties satisfy required partitioning properties; (b) determining whether delivered sorting properties satisfy required sorting properties; and (c) determining whether delivered grouping properties satisfy required grouping properties. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
-
18. One or more hardware memory devices, not being a signal per se, storing computer-useable instructions that, when used by one or more computing devices, cause the one or more computing devices to perform a method comprising:
-
determining whether a first physical operator can provide an output that satisfies a particular structural property requirement based on at least matching the first physical operator output and the particular structural property requirement, wherein matching comprises comparing the first physical operator output to the particular structural property, the particular structural property requirement defines a partition, sort, and group structure of input data required from the first physical operator when the first physical operator can provide an output that satisfies the particular structural property requirement, considering the first physical operator for optimization and pushing structural property requirements imposed by the first physical operator to child expressions; and when the first physical operator cannot provide an output that satisfies the particular structural property requirement, and the first physical operator can preserve structural property requirements, considering the first physical operator for optimization and pushing the particular structural property requirement to child expressions, and when the first physical operator cannot provide an output that satisfies the particular structural property requirement, considering the first physical operator for optimization, adding a new physical operator that satisfies the particular structural property requirement, and optimizing child expressions without imposing the particular structural requirement on child expressions. - View Dependent Claims (19, 20)
-
Specification