List:General Discussion« Previous MessageNext Message »
From:Johan De Meersman Date:October 11 2011 1:51pm
Subject:Re: Index question
View as plain text  
----- Original Message -----
> From: "Rik Wasmus" <rik@stripped>
> 
> Depends on the data and usage, but probably I'd go for a index(a,b) &
> index(b,a) if reads heavily outnumber writes.  As index(a) is covered
> by index(a,b), and index(b) by index(b,a), we don't need to add those,
> which saves time on modifications.

I'm trying to think of a scenario where index(a) would be beneficial in the presence of
index(a,b). If both are available, and all else being equal, it's likely that the parser
will pick the simplest index; but I can't see it having a major impact.

Any full prefix of a combined index may be used; so afaik a separate index on any full
prefix is a waste of diskspace and cycles.

The net conclusion, Neil, is that you actually have to know what you're doing :-) Take the
time to read the online documentation on mysql.com, it's pretty good.


-- 
Bier met grenadyn
Is als mosterd by den wyn
Sy die't drinkt, is eene kwezel
Hy die't drinkt, is ras een ezel
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