summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-03-20 23:27:08 +0100
committerSergei Golubchik <sergii@pisem.net>2014-03-20 23:27:08 +0100
commit3bb249612fe3864f152aa990d4d5f267ac9bb688 (patch)
tree4d3c2f0d1b2d4334ed098bf4d7955570045d065e /sql/handler.h
parentdee0fd42334f9ec03dd761d9fabbdecedcb31528 (diff)
downloadmariadb-git-3bb249612fe3864f152aa990d4d5f267ac9bb688.tar.gz
MDEV-5846 MySQL Bug #18144 - Cost with FORCE/USE index seems incorrect in some cases.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/handler.h b/sql/handler.h
index e67e68be931..37c2c86dce8 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2721,6 +2721,18 @@ public:
}
virtual double scan_time()
{ return ulonglong2double(stats.data_file_length) / IO_SIZE + 2; }
+
+ /**
+ The cost of reading a set of ranges from the table using an index
+ to access it.
+
+ @param index The index number.
+ @param ranges The number of ranges to be read.
+ @param rows Total number of rows to be read.
+
+ This method can be used to calculate the total cost of scanning a table
+ using an index by calling it using read_time(index, 1, table_size).
+ */
virtual double read_time(uint index, uint ranges, ha_rows rows)
{ return rows2double(ranges+rows); }