Home » Performance » MySQL » PRIMARY KEY or FOREIGN KEY?
PRIMARY KEY or FOREIGN KEY? [message #1456] Thu, 21 June 2007 20:29 Go to previous message
omakase  is currently offline omakase
Messages: 3
Registered: June 2007
Junior Member
Say I have a users table with uid, name, email, and password with a PRIMARY KEY on uid and a UNIQUE KEY on email.

Now I want to create a profiles table with uid, and other extended profile information. Should uid be a PRIMARY KEY or a FOREIGN KEY referencing uid from users in this case?

Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Mysql Server tuning
Next Topic:InnoDB Backup
Goto Forum:

  


Current Time: Thu Jul 9 21:34:33 EDT 2009

Total time taken to generate the page: 0.02123 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software

MySQL is a trademark of Sun Microsystems.
InnoDB is a trademark of Oracle Corp.

Percona Performance Forums are a service of Percona, Inc.
Not affiliated with Sun Microsystems or Oracle Corp.