Hi,

Is it such a big deal to use more than one field for a primary key? Two
field keys are only a little slower than single field Primary keys for
selects. Often in linking tables you want to have duplicates of the two
foreign keys right? 

I just wish people would stop making 100 field tables, then I would be
happy.  Ever do an insert on a 78 row table that has all fields set to NOT
NULL, yet you only need to insert about 15 columns worth of data? 
It isn't pretty..  And BTW, do people not ever read the mySQL site? Ever
heard of InnoDB, Berkely DB? Yes, foreign keys, even cascade deletes. Is
this going to become one of those Perl sucks because it is CGI kind of
things? mySQL truly rocks, it keeps getting better and better. Actualy I
started a project recently where I thought I would go ahead be a good boy,
and use foreign keys, it ends up that I just can't think of a good reason
for it in my particular situation. I was kind of disappointed really.. But I
am very happy to know that at any time, if I want transactions and foreign
keys, it is a few keystrokes away. 


Eric 

PS why oh why do people make 100 field tables! 

At 11:35 PM 7/27/02 -0500, Dave Dutcher wrote:
>Well, there are people who feel that tables should be linked by foreign keys
>to ensure referential integrity.  Everyone who uses MySQL gets by without
>them though.  Its up to your coding to make sure referential integrity is
>not violated.
>
>Although foreign keys are left out of MySQL for performance reasons, and
>there is ussualy not much performance hit for having a primary key and most
>of the time there is probably a performance gain.  So I think generally a
>primary key is a good thing, unless you have a strange situation where for
>performance reasons (speed or size) a primary key doesn't make sense.
>
>Dave
>
>
>-----Original Message-----
>From: Desmond Lee [mailto:[EMAIL PROTECTED]]
>Sent: Saturday, July 27, 2002 9:27 PM
>To: [EMAIL PROTECTED]
>Subject: help me out here guys... you gotta have a primary key
>
>
>k....
>
>This is seems ridiculous to me,.. but i'll let you tell me if i'm just being
>stubborn.
>
>So, one of my associates has made a linking table (some people also call it
>intersection table, cross tab table, but i believe that the propper way to
>model a many to many relationship is via a "linking table"). in the linking
>table, there is no primary key defined. I believe that every table must have
>a primary key. It is absolutely essential, otherwise you'll get tons of
>problems including redundancy, and inconsistency. However, my associate
>believes that our coding will ensure that such problems will be avoided and
>that it's okay for a table to have no primary key defined. I totally
>disagree. Even if our code is perfect, a primary key must be defined.
>
>So, am i correct in being concerned, or am i just being close minded?
>If, i'm totally wrong, in what situations is it a good idea, okay, or
>benificial to not have a primary key defined for a table?
>
>
>Thanks
>
>Desmond
>
>
>(sql)
>
>
>_________________________________________________________________
>Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail <[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

http://www.kwinternet.com/eric
(250) 655 - 9513 (PST Time Zone)

"Inquiry is fatal to certainty." -- Will Durant 





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to