Clustered index and non-clustered index of SQL Server

Source: Internet
Author: User

Clustered index:The data stored in the table is stored in the order of indexes. the retrieval efficiency is higher than that of normal indexes, but it has a greater impact on the addition, modification, and deletion of data.
Non-clustered index:It does not affect the data storage sequence in the table. The retrieval efficiency is lower than that of clustered indexes, and has little impact on data addition, modification, and deletion.
A table has only one clustered index and multiple non-clustered indexes.

The following table describes the applicability of clustered indexes and non-clustered indexes:

Action Description Use clustered Index Use non-clustered Index
Columns are sorted by group. Ying Ying
Returns data within a certain range. Ying Should not
Returns the exact matched data. Should not Ying
One or few different values Should not Should not
Different decimal values Ying Should not
Different values of large numbers Should not Ying
Frequently updated Columns Should not Ying
Foreign key column Ying Ying
Primary Key Column Ying Ying

NOTE: If primary key columns are identified and often used for range queries, clustering indexes are applicable; otherwise, non-clustering indexes are applicable.

Here is a detailed discussion: http://blog.csdn.net/ChinaOffLineSoft/archive/2006/04/11/659725.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.