Re: multiple primary keys on one table?

2006-10-06 Thread Renish
right... - Original Message - From: "Gabriel PREDA" <[EMAIL PROTECTED]> To: "Ferindo Middleton" <[EMAIL PROTECTED]> Cc: "Dan Buettner" <[EMAIL PROTECTED]>; Sent: Friday, October 06, 2006 6:31 PM Subject: Re: multiple primary keys on one

Re: multiple primary keys on one table?

2006-10-06 Thread Gabriel PREDA
You will have to UPDATE to NULL those fields, modify the aplication to enter NULL instead of empty-string... Then add the UNIQUE INDEX... In MySQL (unless modified) the dafault is that NULL values are incomparable thus allowing the creation of a UNIQUE INDEX. -- -- -- -- -- -- -- -- -- -- -- --

Re: multiple primary keys on one table?

2006-10-06 Thread Martijn Tonies
> I have a primary key set on a table which consists of the combination of the > values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this > so the records in this table do not have duplicates, being that no one > record should have the exact same name and schedule_id identifier.

Re: multiple primary keys on one table?

2006-10-05 Thread Ferindo Middleton
Thanks. I now have this issue where I can't create the unique index on this table because the email_address is often times blank or unknown for a while (The front-end_application sets is value to '' (blank) on inserts and updates if the user doesn't enter it so instead of going in as NULL, the fie

Re: multiple primary keys on one table?

2006-10-05 Thread Miles Thompson
At 06:26 PM 10/5/2006, Ferindo Middleton wrote: I have a primary key set on a table which consists of the combination of the values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this so the records in this table do not have duplicates, being that no one record should have the ex

Re: multiple primary keys on one table?

2006-10-05 Thread Dan Buettner
Ferindo, you can create multiple UNIQUE indexes on a table to enforce your data requirements. http://dev.mysql.com/doc/refman/5.0/en/alter-table.html Dan On 10/5/06, Ferindo Middleton <[EMAIL PROTECTED]> wrote: I have a primary key set on a table which consists of the combination of the values:

multiple primary keys on one table?

2006-10-05 Thread Ferindo Middleton
I have a primary key set on a table which consists of the combination of the values: firstname, lastname, and a schedule_id (BIGINT(20))... I have this so the records in this table do not have duplicates, being that no one record should have the exact same name and schedule_id identifier. However

Re: Multiple primary keys

2006-04-27 Thread Gordon
AIL PROTECTED]> To: "'Kishore Jalleda'" <[EMAIL PROTECTED]> Cc: Sent: Thursday, April 27, 2006 9:11 AM Subject: RE: Multiple primary keys Thanks all. The query I run is a subquery. I noticed joined query run a lot faster than the sub. This is the sub

RE: Multiple primary keys

2006-04-27 Thread nngau
218 classC: 357 So not having a primary key/index will slow my queries? -Original Message- From: Kishore Jalleda [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 10:49 AM To: nngau Cc: mysql@lists.mysql.com Subject: Re: Multiple primary keys On 4/27/06, nngau <[EMAIL PROT

Re: Multiple primary keys

2006-04-27 Thread Kishore Jalleda
On 4/27/06, nngau <[EMAIL PROTECTED]> wrote: > > Can someone figure out what's going on. This is the only change > I made to this table. Basically I don't want any duplicate rows, so > I setup 4 fields to be my primary key. > > When I do a simple select query it takes nearly 30 seconds to complete.

Re: Multiple primary keys

2006-04-27 Thread chriswhite
Quoting nngau <[EMAIL PROTECTED]>: Can someone figure out what's going on. This is the only change I made to this table. Basically I don't want any duplicate rows, so I setup 4 fields to be my primary key. If you don't want any duplicate rows, use UNIQUE, all those primary keys will just take

Multiple primary keys

2006-04-27 Thread nngau
Can someone figure out what's going on. This is the only change I made to this table. Basically I don't want any duplicate rows, so I setup 4 fields to be my primary key. When I do a simple select query it takes nearly 30 seconds to complete. This is affecting my websites and taking a very long t

RE: Table with multiple primary keys - How

2006-03-08 Thread fbsd_user
@lists.mysql.com Subject: Re: Table with multiple primary keys - How It is not possible to have more than one PRIMARY key per table. Maybe you need to use one PRIMARY key as the main index into the table, then use UNIQUE or KEY which is a synonym for INDEX on the other two columns. This book will

Re: Table with multiple primary keys - How

2006-03-08 Thread mysql
It is not possible to have more than one PRIMARY key per table. Maybe you need to use one PRIMARY key as the main index into the table, then use UNIQUE or KEY which is a synonym for INDEX on the other two columns. This book will help you ALOT with designing tables. It will also teach you how

Re: Table with multiple primary keys - How

2006-03-07 Thread Rhino
- Original Message - From: "fbsd_user" <[EMAIL PROTECTED]> To: Sent: Tuesday, March 07, 2006 11:40 PM Subject: Table with multiple primary keys - How What I am trying to do here is have 3 separate primary keys. Creating a mysql select on either of the Logon_id

Re: Table with multiple primary keys - How

2006-03-07 Thread Dan Nelson
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. C

Table with multiple primary keys - How

2006-03-07 Thread fbsd_user
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. I don't want those 3 field concatenated together as a

Re: Single vs Multiple primary keys

2005-05-16 Thread Daniel Walker
On Sunday 15 May 2005 20:31, Dan Bolser wrote: > You must mean a multipart primary key with three parts :) > > or "multiple-column indexes" > > That is what I would do (use a multiple-column index (primary key) - its > kinda based on opinion, but I think you should let the real data be the > prima

Re: Single vs Multiple primary keys

2005-05-15 Thread Dan Bolser
>> What I want to ensure is that there are no duplicate records when >considering the three foreign keys above. Would it be appropriate to remove >the single primary and replace with three multiple primary keys? Is there a >performance impact when doing this. this seems overly complex

Re: Single vs Multiple primary keys

2005-05-15 Thread Martijn Tonies
ing the three foreign keys above. Would it be appropriate to remove the single primary and replace with three multiple primary keys? Is there a performance impact when doing this. this seems overly complex and wonder if I should be breaking the table up to simplify? Any suggestions would be appreciate

Single vs Multiple primary keys

2005-05-15 Thread Bartis, Robert M (Bob)
foreign keys above. Would it be appropriate to remove the single primary and replace with three multiple primary keys? Is there a performance impact when doing this. this seems overly complex and wonder if I should be breaking the table up to simplify? Any suggestions would be appreciated. Bob

Re: Referencing multiple primary keys

2004-02-11 Thread Jonas Lndén
lt;[EMAIL PROTECTED]> Sent: Wednesday, February 11, 2004 2:49 PM Subject: Referencing multiple primary keys Hello, I am banging my head against the wall trying to figure out how to construct a foreign key towards a table with a primary key consisting of two columns. I have been googling around

Referencing multiple primary keys

2004-02-11 Thread Jonas Lndén
Hello, I am banging my head against the wall trying to figure out how to construct a foreign key towards a table with a primary key consisting of two columns. I have been googling around and thought this would work, but it just gives me an ERROR 1005. ALTER TABLE testDB ADD FOREIGN KEY (fkey1, f