Article ID: 251277
Article Last Modified on 6/9/2000
APPLIES TO
- Microsoft SQL Server 7.0 Standard Edition
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.
Additional query words: slow performance optimize bad poor plan
Keywords: kbprb KB251277