Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In other words, how does MySQL find the result range with indexes on the first step when it's executing a select query?

share|improve this question

migrated from Mar 4 '13 at 3:44

This question came from our site for professional and enthusiast programmers.

That is really the job of the MySQL Query Optimiser. You can determine more information by evaluating the results of EXPLAIN.

You can also manually tweak the Query Optimiser by forcing or hinting an index, or changing the optimizer_search_depth variable which will tell the Query Optimiser how far in the future of each incomplete plan the optimizer should look to evaluate whether it should be expanded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.