I am asking this now and doing the research later because of a pressing deadline. The question relates to SQL Server 2000.
The table in question has a composite key of Org_Unit_Id, Start-Range and End-Range. This is a natural composite key because there is a KPI summary record for every Org Unit and Start-Range(month). In addition there is a record for the previous financial year and YearToDate (this is why End-Range is added to the key - Org_Unit_Id and start-range no longer uniquely identify the record).
The data is exclusively accessed by selecting a date range(using Start-Range) for a particular Org-Unit.
The question I have is whether I flag the composite Primary Key as indexed and whether it should be clustered or non-clustered. Do I index all fields comprising the key?Depending on the answer, how do I add the constraint that sets it up.
The risk with keeping an open mind is having your brains fall out.
Shaunk
The table in question has a composite key of Org_Unit_Id, Start-Range and End-Range. This is a natural composite key because there is a KPI summary record for every Org Unit and Start-Range(month). In addition there is a record for the previous financial year and YearToDate (this is why End-Range is added to the key - Org_Unit_Id and start-range no longer uniquely identify the record).
The data is exclusively accessed by selecting a date range(using Start-Range) for a particular Org-Unit.
The question I have is whether I flag the composite Primary Key as indexed and whether it should be clustered or non-clustered. Do I index all fields comprising the key?Depending on the answer, how do I add the constraint that sets it up.
The risk with keeping an open mind is having your brains fall out.
Shaunk