Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advise re Indexing and Clusters

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
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

 
If you have already defined Org_Unit_Id, Start-Range and End-Range. in your table as the PK then you already have a unique clustered index.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top