List:General Discussion« Previous MessageNext Message »
From:Neil Tompkins Date:October 11 2011 1:00pm
Subject:Re: Index question
View as plain text  
In this instance would you create four indexes key(a) key(b) key(a,b) key (b,a) ? Or is
the decision based on the query response time ?

On 11 Oct 2011, at 13:40, Rik Wasmus <rik@stripped> wrote:

>> Next question. If you have the two separate indexes and then do two
>> queries, one for a and one for b. If you then get a list of unique id's
>> of both, would it be faster to create an intersection yourself rather
>> than have the server do the legwork?
> 
> If you only have 2 unrelated indexes on a & b, it depends on the data, the 
> distribution of values, etc. No single answer here, test with your data and 
> you'll have the results.
> 
> If you need it often, I'd go for the combined index & let MySQL do the work, 
> which is probably fastest. 
> -- 
> Rik Wasmus
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 
Thread
Index questionAlex Schaft11 Oct
  • Re: Index questionJohan De Meersman11 Oct
    • Re: Index questionNeil Tompkins11 Oct
      • Re: Index questionRik Wasmus11 Oct
        • Re: Index questionAlex Schaft11 Oct
          • Re: Index questionAlex Schaft11 Oct
          • Re: Index questionRik Wasmus11 Oct
            • Re: Index questionNeil Tompkins11 Oct
              • Re: Index questionRik Wasmus11 Oct
                • Re: Index questionJohan De Meersman11 Oct
                  • Re: Index questionTompkins Neil11 Oct
                    • Re: Index questionJohan De Meersman12 Oct
  • Re: Index questionArthur Fuller11 Oct