Home > Database > Difference between Clustered and Non-Clustered Index Data Structures

Difference between Clustered and Non-Clustered Index Data Structures

May 28th, 2009
1 Star2 Stars3 Stars4 Stars5 Stars (25 votes, average: 4.12 out of 5)

When you first create a new table, there is no index created by default. In technical terms, a table without an index is called a “heap”. As you would expect, the data we will insert into the table will be returned in the same order. A non-clustered index is a special type of index in which the logical order of the index does not match the physical stored order of the rows on disk. The leaf node of a non-clustered index does not consist of the data pages. Instead, the leaf nodes contain index rows.

A clustered index is a special type of index that reorders the way records in the table are physically stored. Therefore table can have only one clustered index. The leaf nodes of a clustered index contain the data pages.

Clustered index is good when you know in which order you will be returning the records in most cases. You can create clustered index and after that you don’t need to use ORDER BY statement. This will be much more faster. If the order is not important for you and will not create clustered index by yourself, then primary key will be clustered index by default. There is nothing bad not to have the clustered index, it can speed up inserting rows.

Share and Bookmark:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • blogmarks
  • DotNetKicks
  • E-mail this story to a friend!
  • Furl
  • Live
  • Reddit
  • Slashdot
Did you found this article helpful?
Buy me a coffee :)

Database

  1. January 10th, 2012 at 11:39 | #1

    thanks fro the help i rely appriciate big up

  2. Priya PAdhy
    February 16th, 2012 at 09:48 | #2

    very nice

  3. dheep
    March 21st, 2012 at 08:24 | #3

    hey thanks :)

  4. March 31st, 2012 at 13:33 | #4

    hello there and thank you for your information – I’ve definitely picked up something new from right here. I did however expertise several technical points using this website, since I experienced to reload the website a lot of times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I am complaining, but sluggish loading instances times will often affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords. Well I am adding this RSS to my email and can look out for much more of your respective exciting content. Ensure that you update this again soon..

  5. Kumar Vaddadi
    May 16th, 2012 at 07:22 | #5

    good informative, I learned new things about clustered-index

  1. No trackbacks yet.