How to Optimize MySQL Queries Using Indexes

When optimizing a query, the order of fields matter in a multi-field index.

In general, you should use the most selective fields first.

For example, in a hypothetical location index, use zip, city, state, rather than the reverse.

Source: MySQL Forums, Jay Pipes, Performance Tuning Best Practices Presentation


This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>