Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

I don't have a ton of background with MySQL, and I was wondering of anyone can give me some insight into MySQL's query optimizer and the impact on the cost of disk accesses in determining a query plan for query execution. I'm interested in whether any statistics collected on disk access times can play an impact on the query execution plan for a fixed set of queries. In particular, when running the same set of queries on the same database image that resides on different drives with varying performance. (note that from MySQL's point of view, this is the same database; the data directory simply resides on different drives that get switched "under" MySQL without it knowing). Could this change in observed disk performance potentially impact the query plan decisions the query optimizer makes at runtime? I expect that there are many other things more related to SQL itself that the optimizer could do before taking disk accesses into account, but some of you have a lot more experience in dealing with the query optimizer than me.

Thanks for the help!

share|improve this question

From what I've read, MySQL does not collect statistics on disk access times or use them in the query optimizer. A cost unit in MySQL = random read of a data page of 4KB. This is from 2007 so it may have changed.

share|improve this answer
Thanks for the help! – user73111 Mar 10 '11 at 0:49

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.