Re: index, unique index question

2007-08-14 Thread Kristian Myllymäki
A composite index on both columns may be used by queries involving either both columns, or the first column in the index. http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html So, an index on (receiver_id, sender_id) may be used by predicates on both columns or receiver_id

RE: index, unique index question

2007-08-14 Thread Dowd, Noah
3:50 AM To: Ananda Kumar Cc: James Tu; MySQL List Subject: Re: index, unique index question A composite index on both columns may be used by queries involving either both columns, or the first column in the index. http://dev.mysql.com/doc/refman/5.0/en/multiple-column-indexes.html So, an index

Re: index, unique index question

2007-08-14 Thread Martijn Tonies
questions? Check the forum! http://www.databasedevelopmentforum.com -Noah -Original Message- From: Kristian Myllymäki [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:50 AM To: Ananda Kumar Cc: James Tu; MySQL List Subject: Re: index, unique index question A composite index on both

Re: index, unique index question

2007-08-14 Thread Ananda Kumar
- From: Kristian Myllymäki [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 14, 2007 3:50 AM To: Ananda Kumar Cc: James Tu; MySQL List Subject: Re: index, unique index question A composite index on both columns may be used by queries involving either both columns, or the first column

index, unique index question

2007-08-13 Thread James Tu
I have a table that has a Primary key using the 'id' column. The table also has a 'receiver_id' and a 'sender_id'. I have queries that will use (1) WHERE receiver_id = or (2) WHERE sender_id= but never WHERE receiver_id='###' AND sender_id='###' Also, I want the receiver_id/sender_id pair to be

Re: index, unique index question

2007-08-13 Thread Ananda Kumar
Hi James, Since your queries have both receiver_id and sender_id in the where condition and u want this to be unique, just create one combined unique index on both these columns. Do this at db level will give you much better options, performance, rather than doing at code level, which might

Re: ?difference between Primary Key, Key, Index, Unique

2001-02-25 Thread Bob Hall
On Sat, Feb 24, 2001 at 09:43:45AM -0700, Karl Stubsjoen wrote: I'm trying to understand MySQL indexing but am having trouble understanding the differnences (and when to use each) between Primary Key, Key, Unique, an Index. Can you help? Index and Key are the same. A Primary Key is

?difference between Primary Key, Key, Index, Unique

2001-02-24 Thread Karl Stubsjoen
Hello, I'm trying to understand MySQL indexing but am having trouble understanding the differnences (and when to use each) between Primary Key, Key, Unique, an Index. Can you help? Thank you!

Re: ?difference between Primary Key, Key, Index, Unique

2001-02-24 Thread Jeremy D. Zawodny
On Sat, Feb 24, 2001 at 09:43:45AM -0700, Karl Stubsjoen wrote: I'm trying to understand MySQL indexing but am having trouble understanding the differnences (and when to use each) between Primary Key, Key, Unique, an Index. Can you help? Index and Key are the same. A Primary Key is a

Re: INDEX() / UNIQUE()

2001-02-07 Thread Harald Fuchs
on a related but slightly different example, what would happen if you had a Primary Key consisting of 2 columns a b (so the pkey enforces a unique combination of a b) and then created an index on one of the columns eg b. Would the index on b have any effect, or does a primary key on 2

INDEX() / UNIQUE()

2001-02-06 Thread Jacob Friis Larsen
Is there any idea in using both a INDEX() and UNIQUE() index on the same table field ? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive)

Re: INDEX() / UNIQUE()

2001-02-06 Thread Rolf Hopkins
38 Subject: INDEX() / UNIQUE() Is there any idea in using both a INDEX() and UNIQUE() index on the same table field ? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists

RE: INDEX() / UNIQUE()

2001-02-06 Thread Daniel Kirk
PROTECTED] Subject: Re: INDEX() / UNIQUE() Why would you want to? UNIQUE() is an INDEX() the only difference being that UNIQUE can not have the same value a number of times whereas INDEX you can. - Original Message - From: "Jacob Friis Larsen" [EMAIL PROTECTED] To: [EMAIL PROTE