WL#7340: IO aware cost estimate function for data access

Affects: Server-Prototype Only   —   Status: Complete

The optimizer cost model does not have information about whether data
is cached in a memory buffer or needs to be read from disk (or fetched over a
network in the case of NDB). When estimates are supported by storage engines,
the cost models for data access methods should be updated to take into account
whether data will be read from disk or already be present in a memory buffer.

This worklog extends the optimizer cost model to:

 -use the estimates from the handler/storage engines about how much of tables
and indexes are present in memory
 -use different cost constants for the cost of accessing data that is in memory
and data that needs to be read from disk

Note that currently, the estimates about whether data is in memory or needs to
be read from disk is just based on heuristics (with the exception of the memory
engine). The accuracy of these estimates will be greatly improved when support
for these estimates are implemented by the storage engines.

User Documentation
==================

http://dev.mysql.com/doc/relnotes/mysql/5.7/en/news-5-7-8.html
http://dev.mysql.com/doc/refman/5.7/en/cost-model.html