|
Mailing Lists
|
Home /
Groups /
SQL
to cluster or to set free
By default, the primary key index of any table created in MS SQL isMichael Dinowitz 11/14/11 06:38 P One important question to ask yourself: Is this table related to otherCarl Von Stetten 11/15/11 04:56 P By default, the primary key index of any table created in MS SQL is set to unique and clustered. I see no reason for the PK to be clustered and usually rebuild the index, removing the cluster from it. Sometimes I assign it to a field that actually does cluster. Other times I just leave it alone. Is there some secret to the use of unique clustered indexes that I'm missing? Thanks Michael One important question to ask yourself: Is this table related to other tables? If so, is the primary key used to join with other tables? If so, you probably want to leave the primary key index clustered. The clustered index actually stores all of the table content, so a join using a clustered primary key index will be faster than joining to a non-clustered primary key index (because this will require additional SQL operations to retrieve the rest of the table's content). HTH, Carl On 11/14/2011 3:38 PM, Michael Dinowitz wrote: ----- Excess quoted text cut - see Original Post for more -----
|
May 19, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||