List:General Discussion« Previous MessageNext Message »
From:Steve Yates Date:December 5 2002 11:24pm
Subject:Re: Questions Compressed Tables & Indexs
View as plain text  
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 ~

Thread
Re: Questions Compressed Tables & IndexsMichael She5 Dec
  • Re: Questions Compressed Tables & IndexsDan Nelson5 Dec
    • Re: Questions Compressed Tables & IndexsMichael T. Babcock6 Dec
  • Re: Questions Compressed Tables & IndexsSteve Yates6 Dec