Results 1 to 2 of 2

Thread: Indexes

  1. #1
    Join Date
    Aug 2009
    Posts
    12

    Unanswered: Indexes

    Hi All,

    Can anyone explain me what is indexes in sql server and difference between clustered index and non clustered index with an simple example...

    I am not able to understand it...

    Thanks

  2. #2
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    ChinnuBlr, A Clustering Index is one where the Data rows are in the same order as the Clustering Index key(s).

    The only thing strange about a SQL Server Clustering Index (at least to an old DB2 DBA) is is NOT a separate index. Instead the pages of the table are the Leaf pages of the index.

    A couple of benefits of this approach is the Clustering Index takes up very little extra space (just as much as the root page and non-leaf pages take) and the table data has to be in 100 percent clustering order at all times (since they are the Index Key(s) and the Index has to be in order).

    One other thing to note (unless this has changed in SQL Server 2005 or 2008). If you have a Clustering Index and one or more non-clustering Indexes on a table and you drop the Clustering Index, all the other non-clustering indexes are also dropped (it is either that or you have to drop the non-clustering indexes first). Either way, you have extra work around dropping a Clustering Index than just that index itself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •