MySQL Forums
Forum List  »  Performance

Re: Optimize complex query with arithmetic calculations
Posted by: Craig Matthews
Date: June 03, 2005 10:08PM

Thanks for your thoughts.

I am wondering if every website that runs MySQL has indexes like in your example, which is what my DB looks like now!

So assuming I have 4 columns in the most-accessed main table, I have a variety of permutations of WHERE conditions:

where col1 = xyz
where col2 = xyz
where col3 = xyz
where col4 = xyz
where col1 = xyz and col3 = abc
where col2 = xyz and col3 = abc
..etc

So for each of these situations, is it customary to have an individual index on the columns, and then composite indexes?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.