Reason for Auto-increment primary keys?

2005-12-21 Thread Rhino
One technique that I see a lot on this mailing list is people putting auto-incremented integer primary keys on their tables. Maybe I'm just old school but I've always thought that you should choose a primary key based on data that is actually in the table whenever possible, rather than

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Kenneth Wagner
, activity type and updatedbyuserID. So, there's 2 cents worth. Wondering how relevant this is? HTH, Ken Wagner - Original Message - From: Rhino [EMAIL PROTECTED] To: mysql mysql@lists.mysql.com Sent: Wednesday, December 21, 2005 2:54 PM Subject: Reason for Auto-increment primary keys

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Peter Brawley
Hi Rhino, Maybe I'm just "old school" but I've always thought that you should choose a primary key based on data that is actually in the table whenever possible, rather than generating a new value out of thin air. Mebbe every db list should drag this out for re-examination once a year or

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Rudy Lippan
If this trend is real, it doesn't seem like a very good trend to me. For example, if you were keeping track of parts in a warehouse, why would anyone make a table that looked like this: ID (autogenerated PK) PART_NOPART_DESCRIPTION 1 A01

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread SGreen
] To: mysql mysql@lists.mysql.com Sent: Wednesday, December 21, 2005 2:54 PM Subject: Reason for Auto-increment primary keys? One technique that I see a lot on this mailing list is people putting auto-incremented integer primary keys on their tables. Maybe I'm just old school

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Josh Trutwin
Kenneth Wagner wrote: Speed. Especially where related files are concerned. Foreign keys. Links on integer fields are faster, smaller and more efficient. Keys remain smaller and faster. This in my mind is one of the biggest reasons to use an AUTO_INCREMENT column as a primary key when other

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Rhino
- Original Message - From: [EMAIL PROTECTED] To: Kenneth Wagner [EMAIL PROTECTED] Cc: mysql mysql@lists.mysql.com; Rhino [EMAIL PROTECTED] Sent: Wednesday, December 21, 2005 5:15 PM Subject: Re: Reason for Auto-increment primary keys? Kenneth Wagner [EMAIL PROTECTED] wrote on 12/21

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread Kenneth Wagner
to use the ID? Or what's it for? Ken - Original Message - From: Rhino [EMAIL PROTECTED] To: Kenneth Wagner [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: mysql mysql@lists.mysql.com Sent: Wednesday, December 21, 2005 4:57 PM Subject: Re: Reason for Auto-increment primary keys

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread James Harvard
I admit I too am in the habit of always defining an auto_increment primary key, but recently gathered my courage and omitted it from a match-up table joining a table of users to a table of categories they were allowed to use - an auto-generated primary key would have been completely redundant.

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread David Griffiths
]; [EMAIL PROTECTED] Cc: mysql mysql@lists.mysql.com Sent: Wednesday, December 21, 2005 4:57 PM Subject: Re: Reason for Auto-increment primary keys? - Original Message - From: [EMAIL PROTECTED] To: Kenneth Wagner [EMAIL PROTECTED] Cc: mysql mysql@lists.mysql.com; Rhino [EMAIL PROTECTED] Sent

Re: Reason for Auto-increment primary keys?

2005-12-21 Thread SGreen
snipped Shawn, I'm not quite clear what you are saying in your second last paragraph. When you have this situation: ID (autogenerated) PART_NOPART_DESCRIPTION 1 A01 Widget 2 B03Grapple Grommet 3