简体   繁体   中英

Difference between Clustered Index scan and Index scan

I have overcome with the term Clustered index scan over index scan. Does it has any difference.

Yes, there is a difference. A clusted index scan is using a clustered index, a plain index scan is using a non-clustered index.

Have a look at the Microsoft documentation about this topic:

https://docs.microsoft.com/en-us/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described?view=sql-server-2017

Also the differences between those two index were already discussed here: What do Clustered and Non clustered index actually mean?

A table is normally sortet in order of the clustering index. So if you have your clustering index on attribute A, your table is sortet by this Attribute A.

If your table has a high cluster-ratio, the DBMS can pre-load the data it needs, this is called prefetching. Your queries will run faster if this is the case. However, if your clustering-ratio is too low the pre-fetching is not possible and your query will be less performant. So in generall a clustering-index scan should be faster, if your table is clustered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM