Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why table scan?
Message
From
20/02/2008 06:40:39
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01293823
Message ID:
01294169
Views:
28
>Thank you Walter,
>although this is just an example I have the same situation with real data. And believe me both tables have records.
>What surprises me is that if I make that index to be PRIMARY I have INDEX SEEK no matter what I use.

You mean a *clustered* primary index?? If so, I can see that happening. A clustered index makes the data to be stored in the sequence off the index. The order of the data in the table actually *is* the clustered index.

So, if you seek in a clustered index, the rest of the record is avaliable too.
If using a normal index only the indexed values are directly available. The SQL server has to look up the rest of the field values in the actualy table. This is an extra step that costs extra I/O. The optimizer determines the cost of such a process and draws its conclusions and might pick a table scan and do a MERGE JOIN or HASH JOIN.

so, In your case it probably is using a LOOP JOIN with a clustered index seek as that usually is the fasted method to do a LEFT JOIN or even an INNER JOIN.

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform