Dynamic partition selection
First Claim
1. A system comprising one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to perform operations comprising:
- receiving a representation of a query plan generated for a query, the query plan comprising a first plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query, wherein the first plurality of operators in the query plan includes a select operator and a dynamic scan operator, wherein the dynamic scan operator represents a first computing node obtaining tuples from a table that is partitioned into a plurality of partitions by a partitioning key and transferring the tuples to a second computing node that executes a parent operator of the dynamic scan operator;
generating a partition selector operator corresponding to the dynamic scan operator, wherein the partition selector operator represents a third computing node that executes the partition selector operator including determining one or more partition identifiers of partitions of the table and transferring the one or more partition identifiers to the dynamic scan operator of the first computing node;
determining a location in the query plan for the partition selector operator relative to the select operator, including;
determining that the select operator includes a predicate expression on the partitioning key of the table;
in response to determining that the select operator includes a predicate expression on the partitioning key of the table, annotating the partition selector operator with the predicate expression from the select operator; and
pushing the partition selector operator to a child operator of the select operator; and
generating a modified query plan having the partition selector operator at the determined location, wherein the modified query plan includes a second plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query using the partition selector operator including determining, from the predicate expression and a partition selection function, one or more partitions of the table having a range of tuples on the partitioning key that satisfies the predicate expression.
1 Assignment
0 Petitions
Accused Products
Abstract
Methods, systems, and apparatus, including computer programs encoded on computer storage media, for dynamic partition selection. One of the methods includes receiving a representation of a query plan generated for a query, wherein the query plan includes a dynamic scan operator that represents a first computing node obtaining tuples of one or more partitions of a table from storage and transferring the tuples to a second computing node that executes a parent operator of the dynamic scan operator. A partition selector operator is generated corresponding to the dynamic scan operator. A location in the query plan is determined for the partition selector operator. A modified query plan is generated having the partition selector operator at the determined location.
-
Citations
20 Claims
-
1. A system comprising one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to perform operations comprising:
-
receiving a representation of a query plan generated for a query, the query plan comprising a first plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query, wherein the first plurality of operators in the query plan includes a select operator and a dynamic scan operator, wherein the dynamic scan operator represents a first computing node obtaining tuples from a table that is partitioned into a plurality of partitions by a partitioning key and transferring the tuples to a second computing node that executes a parent operator of the dynamic scan operator; generating a partition selector operator corresponding to the dynamic scan operator, wherein the partition selector operator represents a third computing node that executes the partition selector operator including determining one or more partition identifiers of partitions of the table and transferring the one or more partition identifiers to the dynamic scan operator of the first computing node; determining a location in the query plan for the partition selector operator relative to the select operator, including; determining that the select operator includes a predicate expression on the partitioning key of the table; in response to determining that the select operator includes a predicate expression on the partitioning key of the table, annotating the partition selector operator with the predicate expression from the select operator; and pushing the partition selector operator to a child operator of the select operator; and generating a modified query plan having the partition selector operator at the determined location, wherein the modified query plan includes a second plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query using the partition selector operator including determining, from the predicate expression and a partition selection function, one or more partitions of the table having a range of tuples on the partitioning key that satisfies the predicate expression. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. A computer-implemented method comprising:
-
receiving a representation of a query plan generated for a query, the query plan comprising a first plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query, wherein the first plurality of operators in the query plan includes a select operator and a dynamic scan operator, wherein the dynamic scan operator represents a first computing node obtaining tuples from a table that is partitioned into a plurality of partitions by a partitioning key and transferring the tuples to a second computing node that executes a parent operator of the dynamic scan operator; generating a partition selector operator corresponding to the dynamic scan operator, wherein the partition selector operator represents a third computing node that executes the partition selector operator including determining one or more partition identifiers of partitions of the table and transferring the one or more partition identifiers to the dynamic scan operator of the first computing node; determining a location in the query plan for the partition selector operator relative to the select operator, including; determining that the select operator includes a predicate expression on the partitioning key of the table; in response to determining that the select operator includes a predicate expression on the partitioning key of the table, annotating the partition selector operator with the predicate expression from the select operator; and pushing the partition selector operator to a child operator of the select operator; and generating a modified query plan having the partition selector operator at the determined location, wherein the modified query plan includes a second plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query using the partition selector operator including determining, from the predicate expression and a partition selection function, one or more partitions of the table having a range of tuples on the partitioning key that satisfies the predicate expression. - View Dependent Claims (10, 11, 12, 13, 14, 15, 16)
-
-
17. A computer program product, encoded on one or more non-transitory computer storage media, comprising instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:
-
receiving a representation of a query plan generated for a query, the query plan comprising a first plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query, wherein the first plurality of operators in the query plan includes a select operator and a dynamic scan operator, wherein the dynamic scan operator represents a first computing node obtaining tuples from a table that is partitioned into a plurality of partitions by a partitioning key and transferring the tuples to a second computing node that executes a parent operator of the dynamic scan operator; generating a partition selector operator corresponding to the dynamic scan operator, wherein the partition selector operator represents a third computing node that executes the partition selector operator including determining one or more partition identifiers of partitions of the table and transferring the one or more partition identifiers to the dynamic scan operator of the first computing node; determining a location in the query plan for the partition selector operator relative to the select operator, including; determining that the select operator includes a predicate expression on the partitioning key of the table; in response to determining that the select operator includes a predicate expression on the partitioning key of the table, annotating the partition selector operator with the predicate expression from the select operator; and pushing the partition selector operator to a child operator of the select operator; and generating a modified query plan having the partition selector operator at the determined location, wherein the modified query plan includes a second plurality of operators that, when executed by one or more computing nodes, cause the one or more computing nodes to compute a result for the query using the partition selector operator including determining, from the predicate expression and a partition selection function, one or more partitions of the table having a range of tuples on the partitioning key that satisfies the predicate expression. - View Dependent Claims (18, 19, 20)
-
Specification