List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:October 8 2009 5:40pm
Subject:Re: understanding handler::read_time and handler::scan_time
View as plain text  
Hi, Zardosht!

On Oct 08, Zardosht Kasheff wrote:
> handler::index_only_read_time() does not exist in 5.1.36.
> 
> My guess is that it depends on how the return value of scan_time
> relates to get_index_only_read_time(), right?

No, this is the relevant code from best_access_path():

       if (table->covering_keys.is_set(key))
       {
         /* we can use only index tree */
         uint keys_per_block= table->file->stats.block_size/2/
           (keyinfo->key_length+table->file->ref_length)+1;
         tmp= record_count*(tmp+keys_per_block-1)/keys_per_block;
       }
       else
         tmp= record_count*min(tmp,s->worst_seeks);

you don't have much leverage here, I'm afraid.
In 6.0 - where I looked first - this formula is moved to a virtual
method of the handler class, so you can override it.

Frankly speaking, backporting this should be trivial and safe to do in
5.4 (if not in 5.1). Technically, I mean.
 
Regards / Mit vielen Grüßen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
Thread
understanding handler::read_time and handler::scan_timeZardosht Kasheff7 Oct
  • Re: understanding handler::read_time and handler::scan_timeSergei Golubchik7 Oct
    • Re: understanding handler::read_time and handler::scan_timeZardosht Kasheff7 Oct
      • Re: understanding handler::read_time and handler::scan_timeZardosht Kasheff8 Oct
        • Re: understanding handler::read_time and handler::scan_timeMichael Widenius8 Oct
        • Re: understanding handler::read_time and handler::scan_timeSergei Golubchik8 Oct
          • Re: understanding handler::read_time and handler::scan_timeZardosht Kasheff8 Oct
            • Re: understanding handler::read_time and handler::scan_timeSergei Golubchik8 Oct
      • Re: understanding handler::read_time and handler::scan_timeSergei Golubchik8 Oct
      • Re: understanding handler::read_time and handler::scan_timeMichael Widenius8 Oct