Clustered index scan wrongly resorted to in execution plan
From: Randolph Neall (randolphneall_at_veracitycomputing.com)
Date: 08/18/04
- Next message: Cheryl: "Re: Licensing Questions"
- Previous message: Timothy Ross: "Best way to rename a server"
- Next in thread: David Browne: "Re: Clustered index scan wrongly resorted to in execution plan"
- Reply: David Browne: "Re: Clustered index scan wrongly resorted to in execution plan"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 18 Aug 2004 14:29:57 -0400
We are joining table A to table B using an indexed, two-column foreign key
of table B. If table A is restricted to a certain number of records, the
execution plan correctly utilizes the foreign key index on table B (index
seek). But if the restriction on table A is relaxed beyond a certain point,
then the execution plan does a clustered index scan instead, avoiding the
foreign key index on table B--and slowing the query five-fold.
In this rather surprising use of a clustered index scan, the criteria uses
the column functioning as the secondary part of table B's foreign key index,
not the primary portion, which in the execution plan is ignored.
It appears that SqlServer is making a bad decision for us. And we fear it
can only get worse as the database expands in size. What can we do?
Randy Neall
- Next message: Cheryl: "Re: Licensing Questions"
- Previous message: Timothy Ross: "Best way to rename a server"
- Next in thread: David Browne: "Re: Clustered index scan wrongly resorted to in execution plan"
- Reply: David Browne: "Re: Clustered index scan wrongly resorted to in execution plan"
- Messages sorted by: [ date ] [ thread ]