Hi Gabriel,

Can you tell the benefits of a composite index,
compared to 4 individual indices in this case ?
Suppose I need to select on the fields b, c or d.
Then I also need also indices on fields b, c and d.
Together with the composite index on (a,b,c,d),
there is a lot of redundancy in the indices.

Regards, Cor


----- Original Message ----- From: "Gabriel PREDA" <[EMAIL PROTECTED]>
To: "Takanobu Kawabe" <[EMAIL PROTECTED]>
Cc: <mysql@lists.mysql.com>
Sent: Wednesday, June 21, 2006 8:47 AM
Subject: Re: About the leftmost index prefixes using nounique index


Basically it says that if you have an index let's say INDEX_1 on columns:

INDEX_1 : a, b, c, d

MySQL will act as if you had setup indexes on:

INDEX_1_1 : a, b, c
INDEX_1_2 : a, b
INDEX_1_1 : a

A query like:
SELECT a FROM table_name WHERE a > 9; - will use the index
SELECT a, b, c FROM table_name WHERE d > 9; - will use the index

Hope this clears up things !

--
Gabriel PREDA
Senior Web Developer

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to