Take the 2-minute tour ×
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. It's 100% free, no registration required.

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
add comment

migrated from stackoverflow.com Mar 4 '13 at 3:44

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

1 Answer

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
add comment

Your Answer

 
discard

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