Index Seek vs Index Scan in Sql Server [Closed]

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.

1

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

2

In 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

#Index scan vs Index seek

you can also get information from below link

#Index scan vs Index seek in brief

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest