I have a table with a IDENTITY Column as Primary Key (a classic ID column).
SQL Server create automatically a Clustered Index for that Primary Key.
My question is:
If yes, how can I drop the default clustered index and recreate a new one with this attributes.
Thanks for your support
Yes, you can only have a single clustered index per table - the data is physically arranged by that index, so you cannot have more than one.
I would however not advise to use a composite clustered index. Why? Because the clustered index should always be:
INT IDENTITY is perfect as a clustered index - I would advise you keep it that way.
The clustered index column (or set of columns) is also added to each and every entry of each and every nonclustered index on that same table - so if you make your clustered index large, 20, 50 bytes or more, you begin to be wasting a lot of space - on disk and in your server's memory, which generally degrades your system performance.
Read all about clustered indices and what they should be to be good clustered indices here:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With