开发者

What is the difference between Index Scan, Table Scan, and an Index Seek?

开发者 https://www.devze.com 2023-03-04 05:53 出处:网络
Can any one briefly explain what\'s the difference between these 开发者_JAVA百科3 Index Scan, Table Scan, and an Index Seek? Index Scan

Can any one briefly explain what's the difference between these 开发者_JAVA百科3 Index Scan, Table Scan, and an Index Seek?


Index Scan

Index Scan scans each and every record in the index. Table Scan is where the table is processed row by row from beginning to end. If the index is a clustered index then an index scan is really a table scan. Since a scan touches every row in the table whether or not it qualifies, the cost is proportional to the total number of rows in the table. Hence, a scan is an efficient strategy if the table is small.

Index Seek

Since a seek only touches rows that qualify and pages that contain these qualifying rows, the cost is proportional to the number of qualifying rows and pages rather than to the total number of rows in the table.

0

精彩评论

暂无评论...
验证码 换一张
取 消