I've got a table that's a working copy subset of a base table. The base table has a composite key with a clustered index. However I need a single column unique identifier for my framework to work with the table. Both keys are completely unique, and I'll need to make a clustered, unique index on the original, composite key.
Should I keep the composite key as a clustered primary key, or should I use the single column identifier as a non-clustered primary key? Though my framework requires a single identifying column I don't actually have to specify it as the primary key in the DB layer, so I'm not sure which is preferable.
I'm using SQL Server 2005 and the single column identifier will be an IDENTITY
.
IDENTITY
as a FK?IDENTITY
doesn't exist in my source table. So far as I've designed, theIDENTITY
is never used except to update rows via the framework. Queries make extensive use of the composite key though, hence the clustered index to match the source table.JOIN
or query it there's no point in doing anything else to that field.