Using foreign keys is a really, really good idea.  Programs can't be
trusted (and what about running sql queries ad hoc).  Even with a really
big database I wouldn't get rid of the keys, just time to move to a
bigger better machine/configuration.

-----Original Message-----
From: David Felio [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, February 21, 2002 11:19 AM
To: [EMAIL PROTECTED]
Subject: foreign keys to what end? 


I have a MySQL InnoDB table for ACH (checking account) transactions that
includes, among other fields, the below:
trans_id (PRIMARY KEY)
cust_type
routing_num
status
site_id
payment_type
auth_type
trans_type
trace_num

All of the above fields (except the primary key) are related to other
tables that describe the customer type, transaction type, etc. or have
valid values for routing number, status, etc. Should all of these be set
up
as foreign keys, or should some of referential integrity be done
programmatically? How do you draw the line between how many foreign keys
are too many, or is there no such thing? Should things like this always
be
handled by foreign keys instead of error checking in the program? The
indexing along would seem to get fairly large in the transactions table
if
I set them all up as foreign keys.

David Felio
Software Developer
Information Network of Arkansas
http://www.AccessArkansas.org



---------------------------------------------------------------------
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