Description:
The function get_index_only_read_time should be a handler function, whose default implementation is what is currently in opt_range.cc.
This allows storage engines to override its behavior.
Ideally, handler::read_time and handler::get_index_only_read_time can be collapsed into one function with an additional bool as a parameter (stating if it is index_only or not), so that the following code in get_key_scans_params is unnecesary:
if (found_records != HA_POS_ERROR && found_records > 2 &&
read_index_only &&
(param->table->file->index_flags(keynr, param->max_key_part,1) &
HA_KEYREAD_ONLY) &&
!(pk_is_clustered && keynr == param->table->s->primary_key))
{
But this would break existing storage engines.
So, in the meantime, I think making get_index_only_read_time its own handler function would be really helpful.
How to repeat:
n/a
Suggested fix:
n/a