September 6, 2005 at 5:19 pm
select
assid,fk_staffid from assignment where fk_staffid='assole'abv query using index scan when i checked in query analyzer !! when im expecting it to see index seek ? or am i missing something!!
Thanks for ur ideas
September 6, 2005 at 6:06 pm
looks like i need to create an index on this field separately
September 6, 2005 at 6:29 pm
September 6, 2005 at 6:34 pm
actually i thought when we create a foreign key it automatically creates an index
September 6, 2005 at 8:13 pm
September 6, 2005 at 8:20 pm
September 7, 2005 at 2:35 am
If you query on a foreign key and there is no index then you will probably get a Clustered Index Scan.
The question I have is, let us suppose that you don't actually query the foreign key at all, it is just there as a cross reference to a look-up table.
Is it worth creating an index on that foreign key in this instance? I've done some playing around and even if the index on the foreign key is used it seems to increase the cost of the select query, not reduce it
September 7, 2005 at 3:01 pm
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply