Bug #52162 get_index_only_read_time in opt_range.cc should be a handler function
Submitted: 18 Mar 2010 2:45
Reporter: Zardosht Kasheff (OCA) Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Storage Engine API Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any
Tags: get_index_only_read_time, handler, storage engine

[18 Mar 2010 2:45] Zardosht Kasheff
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