BUG: IN Subquery Reformats and Is Slower Than an Equivalent Join (173314)



The information in this article applies to:

  • Microsoft SQL Server 6.5
  • Microsoft SQL Server 6.0

This article was previously published under Q173314

SYMPTOMS

BUG #: 17227 (6.5)

A join combined with an IN subquery may cause a reformat access plan and be much slower than the logically equivalent pure join query. In general, an IN subquery should have approximately the same performance as the equivalent join.

WORKAROUND

Express the IN subquery as join, or break it down to several smaller queries using temporary tables, which collectively produce the same result.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Modification Type:MajorLast Reviewed:10/16/2003
Keywords:kbBug kbusage KB173314