> modified must be updated, but if the primary key cannot be
> modified, that is one less index to update.
Yes, but there's no difference between having to update an index used by a
primary key versus having to update an index used by a field that would be a
possible natural primary key. Let's look at an example. If I had a table
called People, with fields First_Name, Last_Name, and Email_Address as well
as a bunch of other fields, I might decide to use those three fields as a
primary key. As a result, an index would be created that contains all three
fields.
Then, some guy named Date smacks some sense into me, and I create a new
table called People2 with the same fields plus a PersonID field which I set
as a surrogate key. That field would have an index on it. However, I'd still
want to index the fields that would be natural key candidates, since they'd
also be the fields most often used for searches. In many cases, I might even
want to place a unique index on those fields just as if I were in fact using
them as a natural key, to prevent duplicate records.
The upshot is that I wouldn't save any time when I changed the People2
table, as there would still be indexes on the data fields in question.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

