November 15, 2010 at 7:44 pm
I just want to know the difference between index scan and index seek.
I have created two tables with id, title as the columns where id is of datatype integer and title is of datatype varchar(50)
The first table contains no indexes and the second table contains id as the primary key where it keeps a clustered index automatically. I have inserted 100,000 records in both of the tables starting id from 1 to 100,000
When i used to query table 1 it always uses table scan as there is no index
when i used to query table 2 given below
select * from table2 where id <= 5000
select * from table2 where id<=50000
Always it uses index seek only in the execution plan.
When does index scan happen and what is the difference internally. It would be great if someone could explain clearly.
November 15, 2010 at 8:20 pm
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
November 15, 2010 at 10:30 pm
Or http://sqlinthewild.co.za/index.php/2007/11/15/execution-plan-operations-scans-and-seeks/
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
November 16, 2010 at 1:23 am
GilaMonster (11/15/2010)
Or http://sqlinthewild.co.za/index.php/2007/11/15/execution-plan-operations-scans-and-seeks/
You can tell that's a very old entry - the description of how a heap scan works is wrong!
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply