|
Posted by Erland Sommarskog on 10/22/12 11:33
Thomas R. Hummel (tom_hummel@hotmail.com) writes:
> I've also used EXISTS and IN in various queries. No matter which method
> I use, the query plans tend to want to do a clustered index scan on the
> target table (actually a partitioned view partitioned by year). The
> number of headers that were in the target but not the header file this
> month was about 42K out of 1M.
Did you try using an index hint?
But wait, you can't force an index on the view, as the view does not
have any indexes. And maybe there lies the problem. What happens if
you instead join directly to the underlying tables?
--
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
Navigation:
[Reply to this message]
|