Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why only one clustered index per table should be created in sql server?

I have read tips about sql server database on http://www.sql-server-performance.com/2007/clustered-indexes

In conclusion section author mentioned: "Since you can only create one clustered index per table, take extra time to carefully consider how it will be used."

My question is:

*Why only one clustered index per table should be created in sql server? *

like image 350
Hadi Sharifi Avatar asked Jan 30 '14 12:01

Hadi Sharifi


1 Answers

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 faster because sql server doesn't have to read the whole data -- Depends on query. But data retrieval is much faster.

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

like image 59
Punter015 Avatar answered Oct 26 '22 10:10

Punter015