Please explain the difference between Index Scan and Index Seek in MS SQL server with an sample example, since it will be helpful to know, what's the real use of it. Thanks in advance.
12 Answers
Here is the text showplan (slightly edited for brevity) for this query using a scan:
|–Table Scan(OBJECT:([ORDERS]), WHERE:([ORDERKEY]=(2)))The following figure illustrates the scan:
Here is the text showplan for the same query using a seek:
|–Index Seek(OBJECT:([ORDERS].[OKEY_IDX]), SEEK:([ORDERKEY]=(2)) ORDERED FORWARD)have a look on this SQL Server Plans : difference between Index Scan / Index Seek
2In simple words, An index scan or table scan is when SQL Server has to scan the data or index pages to find the appropriate records. A scan is the opposite of a seek, where a seek uses the index to pinpoint the records that are needed to satisfy the query.
your question is similar to the question which is already posted in stackoverflow get it from below link
you can also get information from below link