PRB: Poor Cardinality Estimation for Inequality Expressions in Joins (251277)
The information in this article applies to:
This article was previously published under Q251277 SYMPTOMS
If a query has a join predicate with some inequality expression, like <, <=, >, >=, LIKE, or BETWEEN, and the predicate is also one of the most selective predicates in the query, the query optimizer may fail to pick an optimal plan.
CAUSE
The optimizer is not designed to combine histograms for two different indexes for any situation other than an equality predicate. Instead, a "magic number" is used in estimating the cardinality. If this estimate is considerably different than the actual cardinality, the plan may not be optimal.
WORKAROUND
Use a join and/or index hint to achieve the result you want.
Modification Type: | Major | Last Reviewed: | 6/9/2000 |
---|
Keywords: | kbprb KB251277 |
---|
|