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

The pilot implementation of mwl#250: Use the statistics from persistent

statistical tables instead of the statistics provided by engine.
This commit is contained in:
Igor Babaev
2012-04-11 17:14:06 -07:00
parent ff3d16fba8
commit 1c0a89afcc
15 changed files with 706 additions and 52 deletions

View File

@ -96,6 +96,11 @@ typedef struct st_key {
uint block_size;
uint name_length;
enum ha_key_alg algorithm;
/*
The flag is on if statistical data for the index prefixes
has to be taken from the system statistical tables.
*/
bool is_statistics_from_stat_tables;
/*
Note that parser is used when the table is opened for use, and
parser_name is used when the table is being created.
@ -148,6 +153,15 @@ typedef struct st_key {
/** reference to the list of options or NULL */
engine_option_value *option_list;
ha_index_option_struct *option_struct; /* structure with parsed options */
inline double real_rec_per_key(uint i)
{
if (rec_per_key == 0)
return 0;
return (is_statistics_from_stat_tables ?
(ulong) (100 * read_stat.avg_frequency[i]) / (double) 100 :
(double) rec_per_key[i]);
}
} KEY;