BUG: Multiple OR Clauses Combined with Non-selective Criteria May Result in Slower Plan (282984)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q282984
BUG #: 351567 (SHILOH_bugs)

SYMPTOMS

A query that has multiple OR clauses and fairly non-selective search arguments may result in an execution plan that yields slower performance on a computer that is running SQL Server 2000 than on a computer that is running Microsoft SQL Server 7.0.

CAUSE

An incorrect cardinality estimate is being made.

WORKAROUND

Use a covering index for the query.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 2000.

MORE INFORMATION

Here is one example where the problem may occur given non-selective data (meaning few unique values for Column2):
SELECT E.Column1
FROM ExampleTable E
WHERE (E.Column2 = 'ABCD')		         OR 
      (E.Column2 = 'EFGH' and E.Column3 = 'IJ')  OR 
      (E.Column2 = 'KLM'  and E.Column4 = 'NOP')
				

Modification Type:MajorLast Reviewed:10/3/2003
Keywords:kbBug kbpending KB282984