I think you'll agree that neither your not my arguments are so strong
That's obviously a major factor in SQL/Server; I don't see that it's
as relevant in Access.
Eh? In SQL Server you have an explicit choice over the clustered
index, it doesn't have to be the PK (rarely is?) The only reason I can
think of for having an automnumber/IDENTITY column as the clustered
index would be for a table used as a simple event log i.e. in
timestamp order without using a TIMESTAMP column.
The clustered index is a fundamental principle of all relational
databases, including Jet (MS Access). Think of a paper copy telephone
directory: would you compile it in telephone number order? Or would
you go for something more useful such as (last_name, first_name, area)
etc? Choosing an automnumber as the clustered index is analogous to
listing in telephone number order and how often do you e.g. query data
BETWEEN two telephone numbers?
I guess with Jet in a way you *do* have a choice over the clustered
index by being a bit more 'clever' over the choice of PK. Say I had a
table with columns employee_ID (unique) and employee_last_name
(non-unique). In SQL Server I might choose employee_ID as the PK and,
because I most often use the table for reports in last_name order, I'd
create a separate index on employee_last_name and make it the
clustered index for the table. For Jet, I'd make the PK a compound of
(employee_last_name, employee_ID) in that order so that my clustered
index is on the useful last_name column and, because I want to use
employee_ID as a foreign key in other tables, I'd create a separate
unique index on employee_ID.
What would you go with as PK, just employee_ID? Doing so would mean
your data was always *stored* in the wrong physical order and every
query with an ORDER BY would have the overhead of rearranging into the
correct order. With my approach, I'll still have the ORDER BY clauses
but only the rows added since the last compact would actually have to
be ordered, therefore my queries would run faster than yours.
To say the clustered index is not as relevant in Jet/MS Access is to
miss an important performance issue. You site ON UPDATE CASCADE on a
PK column as a performance issue but surely GROUP BY, BETWEEN or ORDER
BY on a non-PK column is encountered much more frequently?
Jamie.
--