[AccessD] Primary Key Best Practices

Jim Dettman jimdettman at verizon.net
Wed Jul 25 11:51:34 CDT 2007


John,

<<Are there any drawbacks to doing this?>>

  I have never found any.  I've been forced to do it both ways.  Other then
to say that there is some additional overhead with the first rather then the
second, there is no real difference in terms of outcome.

 For me, old habits die hard; I still program like I did when my programs
needed to run in 64K.  As a result, my apps are generally snappier then
most.  Something like this seems like a no-brainer.  In fact, I think doing
it the first way actually confuses the design because there is no obvious
reason for having it that way.

  Of course that could just be me<g>.

Jim. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of John Bartow
Sent: Wednesday, July 25, 2007 11:31 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Primary Key Best Practices

Jim,
This is something I haven't seen before and is in my early morning mind,
quite brilliant! Are there any drawbacks to doing this?

I can't imagine it would be much of a difference (size or performance wise)
in any of my applications / databases but it is certainly something worth
considering implementing in the future.

Always open to technical improvements...

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman

True, but in the case of a M to M table your just introducing another column
and a index that really is not needed.  It seems silly to me to have
something like:

tblLinking
LinkID - Autonumber - PK
BookID - Long - CK1A
AuthorID - Long - CK1B 

Instead of

tblLinking
BookID - Long - PK1A
AuthorID - Long - PK1B


  just for the sake of having an auto number in there.  The BookID and
AuthorID already form a unique pair and they typically would not be used as
a foreign key in another table.








































































































































-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list