Reply to Re: INNER JOIN/Index Threshold?

Your name:

Reply:


Posted by Dave on 01/04/07 23:23

Your correlated subquery works.
It added a stream aggregate step to the execution plan right before the
merge join.

This is really weird. Could it be an SQL Server Bug? Like I said
earlier, it is very data specific. I can add 3 million random records
to the filter table and it normally works fine. It is only this
specific dataset that is causing problems.


Erland Sommarskog wrote:
> Dave (daveg.01@gmail.com) writes:
> > bk is clustered so there is no reason to add it to the other index.
> >
> > Estimated plan does an index scan on each table, then a merge join.
> >
> > When I remove the index on base.email the plan does a table scan on
> > base then performs a Hash Match
>
> And the merge-join plan takes forever? That's indeed very funny, because
> that's sounds like a quite decent plan. Your tables looks funny, because
> they have no keys, but that would matter.
>
> What happens if you try:
>
> SELECT b.hk, b.email
> FROM base b
> WHERE EXISTS (SELECT *
> FROM filter
> WHERE f.email = b.email)
>
>
> Which version of SQL Server?
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
>
> Books Online for SQL Server 2005 at
> http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
> Books Online for SQL Server 2000 at
> http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация