Difference between Table scan,index scan and index seek

Dear Readers, In this Article i am going to introduce "What is the difference between TABLE SCAN , INDEX SCAN and INDEX SEEK".


Table Scan: 

These all are related to Optimization technique in SQL Server. When we are fetching data from table, By default we are scanning whole table to get our particular data. This is called Table Scan.
Ex : Select * From Employee 
Index Scan :  Now we are creating index For Employee Table on there id .
Ex : CREATE INDEX index_employee_id ON Employee(id);
Now we will run same Query "Select * from Employee", In this case we will scan only Index. So it is
called Index Scan.

Index Seek : In this case after creating Index we are executing "Select * from employee where id=1". Means we are fetching data with Id. As we are created index on Employee table by there id . So it is called Index Seek.


Difference between Table scan,index scan and index seek Difference between Table scan,index scan and index seek Reviewed by Ashwani on September 21, 2019 Rating: 5

No comments:

Powered by Blogger.