Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
why only one clustered index per table plz explain with reason
Posted
Updated 11-Jan-17 21:33pm

Quote Microsoft[^]:
A clustered index sorts and stores the data rows in the table based on the index key values. Therefore only one clustered index can be created on each table because the data rows themselves can only be sorted in one order.

To create a different clustered index on the same table, change the Create as Clustered property setting on the existing clustered index before creating the second index.

For more information, see How to: Change Index Properties (Visual Database Tools)[^] and How to: Create Clustered Indexes (Visual Database Tools)[^].
 
Share this answer
 
Hi All,

Cluster index are sorted physically ,the data at the leaf node are sorted on only one particular order since there will be only one cluster index can be created and having its index table associate with leaf node(data page).
Cluster index can also be created for two columns(composite cluster indexing) also,but only one clustered index per table.

Example for cluster index :Telephone book is ordered in the alphabetic way, for example there are two names called raju then it will sort first with first name and then with last name


Non-Clustered index:The data is in leaf node(data page),and are not in order where the row pointer are pointing to the leaf node where the data is located.
the table can have more then one non cluster indexing.

Example for non cluster indexing :Index on books in front page,where the page number points to that particular topic in the book,But it is not ordered in the one particular way.A table can have more then one non cluster index.

Thanks..
 
Share this answer
 
Clustered Index: Clustered index defines the way in which data is ordered physically on the disk. And there can only be one way in which you can order the data physically. Hence there can only be one clustered index per table.

Why care about clustered index? If we put clustered index on the table then the data is retrieved much more faster because sql server doesnot have to read the whole data -- Depends on query. But data retrieval is much more faster.

NOTE: Although you can create more than one Non-Clustered index on a single table.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900