Generalized partition pruning in a database system
View Patent ↗A system for executing a query on data that has been partitioned into a plurality of partitions is provided. The system includes providing partitioned data including one or more columns and the plurality of partitions. The partitioned data includes a limit key value associated with each column for a given partition. The system further includes receiving a query including a predicate on one of the one or more columns of the partitioned data; and utilizing the predicate on the one of the one or more columns in a pruning decision on at least one of the one or more partitions based on the limit key values associated with the plurality of partitions.
1. A computer-implemented system for executing a query on data in a database and organized into a partitioned table that has been partitioned into a plurality of partitions and is accessible by a partitioned index, wherein the computer performs the following functions comprising:
providing partitioned data including one or more columns and the plurality of partitions, the partitioned data including a pre-determined limit key distribution providing limit key values associated with each column for a given partition within the partitioned index;
receiving a query including a predicate on one of the one or more columns of the partitioned data;
utilizing a query optimizer and the predicate on the one of the one or more columns in a pruning decision on at least one of the plurality of partitions in relation to the pre-determined limit key distribution associated with the plurality of partitions,
providing a capability to infer a pseudo-partition into the partitioned index having limit key values in relation to one or more pre-determined conditions by introducing a removable partition subset, and
inferring a pseudo-partition by introducing a removable partition subset having one or more limit key values based on the predicate; and generating a bounded range for column values in a given partition based on the limit key values of the inferred pseudo-partition using the introduced partition subset.
2. The computer-implemented system of claim 1 , wherein the predicate on the one of the one or more columns is utilized in a pruning decision on a given partition if one or more limit key values associated with the given partition is equal to one or more limit key values associated with a second partition of the plurality of partitions.
3. The computer-implemented system of claim 2 , wherein the given partition provides at least one bounded range value for values in the one of the one or more columns.
4. The computer-implemented system of claim 1 , wherein providing partitioned data includes providing a partitioned index or a partitioned table associated with a relational database.
5. The computer-implemented system of claim 1 , wherein:
receiving a query includes receiving a query including a predicate having a host variable which is unresolved; and utilizing the predicate includes utilizing the predicate in a pruning decision at compile time to prune at least one of the plurality of partitions prior to resolving the unresolved host variable at the time of compilation.
6. A computer readable storage medium containing program instructions for executing a query on data in a database that has been partitioned into a plurality of partitions and is accessible by a partitioned index, wherein execution of program instructions by one or more processors of a computer causes the one or more processors to carry out the steps of:
providing partitioned data including one or more columns and the plurality of partitions, the partitioned data including a pre-determined limit key distribution providing limit key values associated with each column for a given partition within the partitioned index;
receiving a query including a predicate on one of the one or more columns of the partitioned data;
utilizing the predicate on the one of the one or more columns in a pruning decision on at least one of the one or more partitions in relation to the pre-determined limit key distribution associated with the plurality of partitions,
providing a capability to infer a pseudo-partition into the partitioned index having limit key values in relation to one or more pre-determined conditions by introducing a removable partition subset, and
inferring a pseudo-partition by introducing a removable partition subset having one or more limit key values based on the predicate; and; generating a bounded range for column values in a given partition based on the limit key values of the inferred pseudo-partition using the introduced partition subset.
7. The computer readable storage medium of claim 6 , wherein the predicate on the one of the one or more columns is utilized in a pruning decision on a given partition if one or more limit key values associated with the given partition is equal to one or more limit key values associated with a second partition of the plurality of partitions.
8. The computer readable storage medium of claim 7 , wherein the given partition provides at least one bounded range value for values in the one of the one or more columns.
9. The computer readable storage medium of claim 6 , wherein providing partitioned data includes providing a partitioned index or a partitioned table associated with a relational database.
10. The computer readable storage medium of claim 6 , wherein:
receiving a query includes receiving a query including a predicate having a host variable which is unresolved; and utilizing the predicate includes utilizing the predicate in a pruning decision at compile time to prune at least one of the plurality of partitions prior to resolving the unresolved host variable at the time of compilation.