SQL Server 2008 Index

Source: Internet
Author: User

Microsoft SQL Server provides two types of indexes: Clustered indexes (clustered index, also known as clustered indexes, clustered indexes), and nonclustered indexes (nonclustered index, also called nonclustered indexes, non-clustered indexes)

Let's say, for example, the differences between clustered and nonclustered indexes:


The body of our Chinese dictionary is itself a clustered index. For example, we have to check the word "eat", it will be very natural to open the first few pages of the dictionary, because "eat" the Pinyin is "Chi", and alphabetical order of Chinese character Dictionary is the English letter "C" beginning with "Z", then "eat" the word naturally ranked in the front of the dictionary. If you have finished all the parts that start with "C" and still can't find the word, then you don't have the word in your dictionary, and again, if you look up the word "Zhang", you will also turn your dictionary into the last part, because "Zhang" is the pinyin "Zhang". That is, the body part of the dictionary is itself a directory, and you do not need to look up other directories to find what you need to find.

We refer to this body of content itself as a directory of certain rules, called a "clustered index."

If you know a word, you can quickly find the word from the code. But you may also encounter the words you do not know, do not understand its pronunciation, at this time, you can not follow the method to find the word you want to check, and need to go to the "radicals" to find the word you are looking for, and then according to the page number after the word directly to a page to find the word you are looking for. But the sort of words you find in combination with the "radicals" and "gept" is not really the sort method of the body, for example, you check the word "Zhang", we can see in the Gept table after the Radicals "Zhang" page number is 672 pages, gept table "Zhang" above is "Chi" word, but the page number is 63 pages, "Zhang" below is "crossbow "Word, page is 390 pages. Obviously, these words are not really in the "Zhang" the word of the upper and lower side, now you see the continuous "Chi, Zhang, crossbow" three words is actually their order in the nonclustered index, is the dictionary body of words in the non-clustered index mapping. We can find the words you need in this way, but it takes two procedures to find the results in the catalog and then turn to the page numbers you need.

we put this kind of directory purely as a directory, the body is purely the sort of body is called "nonclustered index".

From the example above, we can understand what is "clustered index" and "nonclustered index".

Full-text index details to be updated tomorrow

http://bbs.csdn.net/topics/360099568

Unique index: Unique constraint, clustered index created on primary key

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.