Methods of cost estimation using partially applied predicates
AssigneeInternational Business Machines Corporation
InventorsVincent Corvinelli, John Frederick Hornibrook, Bingjie Miao
Life of this patent
Estimating the term…
Abstract
In accordance with aspects of the present invention, provided are methods for incrementally estimating the cardinality of a derived relation including statistically correlated partially applicable predicates for a range-partitioned table. During the generation of a QEP a cardinality estimate is calculated in which one or more partially applicable predicates is correlated to another partially applicable predicate and/or to one or more fully applicable predicates. The cardinality includes a number of rows expected to be returned by the QEP and is computed in an incremental fashion for each operator of the QEP.
Claims9
A method for estimating the cardinality resulting from the application of one or more partially applied predicates against a range-partitioned table of a database, the method comprising:
- identifying at least one key column, wherein the at least one key column at least partially defines one or more data partitions in the range-partitioned table;
- calculating at least one combination of partially applicable predicates;
- calculating the partial selectivities for the at least one combination of partially applicable predicates,
- determining a Query Execution Plan (QEP) based on the estimated cardinality;
- determining whether or not a particular predicate can be partially applied to achieve a useful result;
- computing a corresponding partial selectivity value for the particular predicate, if the particular predicate can be partially applied;
- and
- accessing the range-partitioned table in the database based on a plan specified by the OEP,
- wherein the partial selectivities, psel(pl, . . . , pt), after applying a number of predicates pl, . . . , pt, are equal to a number of qualified partitions divided by the total number of partitions;
- and
- wherein the partially applicable predicates filter the range-partitioned table of the database before full application of the predicate to exclude data partitions based on the partially applicable predicate.
Dependencies are inferred from the claim text.