List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:March 8 2006 4:52am
Subject:Re: Table with multiple primary keys - How
View as plain text  
In the last episode (Mar 07), fbsd_user said:
> What I am trying to do here is have 3 separate primary keys. Creating
> a mysql select on either of the Logon_id, email_addr, or last_name
> fields will do a single read to the matching value.  Like having 3
> different indexes into the same table.

Create one primary key and two unique indexes.  As far as mysql is
concerned, a primary is just another unique index.  I'd make login_id
the real primary key since it should never change, unlike email_addr or
last_name.  Are you sure you want last_name to be unique?  I think that
one should be just a regular index.

-- 
	Dan Nelson
	dnelson@stripped
Thread
Table with multiple primary keys - Howfbsd_user8 Mar
  • Re: Table with multiple primary keys - HowDan Nelson8 Mar
  • Re: Table with multiple primary keys - HowRhino8 Mar
  • Re: Table with multiple primary keys - Howmysql8 Mar
    • RE: Table with multiple primary keys - Howfbsd_user8 Mar