Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Indexes

Tags:

sql

sql-server

what is the difference between clustered index scan and clustered index seek?

like image 782
Anoop Avatar asked Sep 05 '25 03:09

Anoop


1 Answers

A clustered index scan is a table scan on a table that has a clustered index. By default a primary key is a clustered index, so basically a table that has a primary key.

A clustered index scan occurs when the predicate contains columns other than the primary key (and there is no other index available to satisfy the predicate).

A clustered index seek (and non-clustered index seek) occurs when the predicate contains one or more columns in the index. This allows the query processor to lookup the range of rows based on the index, without needing to scan.

like image 69
Brannon Avatar answered Sep 07 '25 21:09

Brannon