On Thu, 05 Dec 2002 15:36:37 -0500, Michael She wrote:
>As for indicies is it better to create a single index per column, or an
>index for a set of columns. For example, if I go: SELECT * FROM SOMETABLE
>WHERE A = X and B = Y. Is it better to create a X AND Y index, or two
>separate indicies?
If you need to ever query on the B field alone and use an
index, it will need its own index. Queries on either field A or fields
A,B together will use an index on A,B. Queries can use one index so in
your example an index on A,B I suspect should be faster.
http://www.mysql.com/doc/en/MySQL_indexes.html
http://www.mysql.com/doc/en/Multiple-column_indexes.html
- Steve Yates
- When you're great people sometimes mistake candor for bragging.
--Calvin
~ Taglines by Taglinator - www.srtware.com ~
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php