On Oct 07, Zardosht Kasheff wrote:
> 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
> 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?
Yes. At least it matches mine :)
> 2) Does the absolute value returned affect the query plan, or is it
> the relative value between these two functions?
I'm afraid that absolute values matter. And the the units of
scan_time/read_time are quite arbitrary and there's no normalization
procedure that would help to select them correctly :(
I suppose that other engines simply tweak these numbers until they get
satisfactory query plans.
Regards / Mit vielen Grüßen,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / 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