List:General Discussion« Previous MessageNext Message »
From:Bryan Cantwell Date:July 6 2010 3:41pm
Subject:combined or single indexes?
View as plain text  
Is there a benefit to a combined index on a table? Or is multiple single
column indexes better?

If I have table 'foo' with columns a, b, and c. I will have a query
like:
select c from foo where a in (1,2,3) and b < 12345;

Is index on a,b better in any way than an a index and a b index?
An explain with one index sees it but doesn't use it (only the where) 
and having 2 indexes sees both and uses the one on b. 

Am I right to think that 2 indexes are better than one combined one?

thx,
Bryancan


Thread
combined or single indexes?Bryan Cantwell6 Jul
  • Re: combined or single indexes?Joerg Bruehe6 Jul
  • Re: combined or single indexes?Octavian Rasnita7 Jul
    • Re: combined or single indexes?Neil Tompkins8 Jul
      • Re: combined or single indexes?Johan De Meersman9 Jul
        • Re: combined or single indexes?Neil Tompkins9 Jul
          • Re: combined or single indexes?Johan De Meersman9 Jul
            • Re: combined or single indexes?mos9 Jul
              • Re: combined or single indexes?Tompkins Neil21 Jul
                • Re: combined or single indexes?MySQL)22 Jul
                  • Re: combined or single indexes?Tompkins Neil22 Jul
                    • RE: combined or single indexes?Jerry Schwartz22 Jul
                      • Re: combined or single indexes?Tompkins Neil22 Jul
                        • RE: combined or single indexes?Jerry Schwartz22 Jul
                          • Re: combined or single indexes?Neil Tompkins23 Jul