1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-5846 MySQL Bug #18144 - Cost with FORCE/USE index seems incorrect in some cases.

This commit is contained in:
Sergei Golubchik
2014-03-20 23:27:08 +01:00
parent dee0fd4233
commit 3bb249612f
4 changed files with 69 additions and 2 deletions

View File

@ -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); }