From: Zardosht Kasheff Date: October 7 2009 2:04pm Subject: understanding handler::read_time and handler::scan_time List-Archive: http://lists.mysql.com/internals/37350 Message-Id: <2f9663ba0910070704u7b8a4032pe5a323cde9772283@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 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