diff options
Diffstat (limited to 'storage/federated/ha_federated.h')
-rw-r--r-- | storage/federated/ha_federated.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index a8d5439bdae..94a30962663 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -180,19 +180,26 @@ public: The reason for "records * 1000" is that such a large number forces this to use indexes " */ - virtual double scan_time() + + IO_AND_CPU_COST scan_time() { DBUG_PRINT("info", ("records %lu", (ulong) stats.records)); - return (double)(stats.records*1000); + return + { + (double) (stats.mean_rec_length * stats.records)/IO_SIZE * avg_io_cost(), + 0 + }; } - virtual double read_time(uint index, uint ranges, ha_rows rows) + IO_AND_CPU_COST rndpos_time(ha_rows rows) { - return rows2double(rows) + rows2double(ranges); + return { (double) stats.records * avg_io_cost(), 0 }; } - virtual double rndpos_time(ha_rows rows) + IO_AND_CPU_COST keyread_time(uint index, ulong ranges, ha_rows rows, + ulonglong blocks) { - return rows2double(rows); + return { (double) (ranges + rows) * avg_io_cost(), 0 }; } + virtual void set_optimizer_cache_cost(double cost); const key_map *keys_to_use_for_scanning() { return &key_map_full; } |