List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:October 7 2009 2:04pm
Subject:understanding handler::read_time and handler::scan_time
View as plain text  
Hello,

I would like to make sure that I understand the meaning of the
functions handler::scan_time and handler::read_time. Both are to be
estimates of the cost of doing some operations on a table.

handler::scan_time estimates the cost of doing a full table scan.
handler::read_time estimates the cost of reading some number of rows
from some number of ranges in an index (assumed to be a non-covering
index).

The estimates requested are meant to be disk seeks.

I have gathered this from reading comments in different handler implementations.

The questions that I need help on are the following:
1) Is my understanding above accurate?
2) Does the absolute value returned affect the query plan, or is it
the relative value between these two functions?
    For example, for some query, if it is the relative value between
these two functions that matter, then returning 100 in
handler::scan_time and 90 in handler::read_time should have same
effect as returning 200 in handler::scan_time and 180 in
handler::read_time. However, if the absolute value returned may affect
the query plan, then returning 200 instead of 100 in
handler::scan_time (or 180 vs. 90 in handler::read_time) may cause the
query planner to behave differently.

Thanks
-Zardosht
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