InnoDB Plugin
1.0
|
#include "univ.i"
#include "db0err.h"
#include "dict0types.h"
#include "trx0types.h"
#include "dict0stats.ic"
Go to the source code of this file.
Enumerations | |
enum | dict_stats_upd_option_t { DICT_STATS_RECALC_PERSISTENT, DICT_STATS_RECALC_TRANSIENT, DICT_STATS_EMPTY_TABLE, DICT_STATS_FETCH_ONLY_IF_NOT_IN_MEMORY } |
Functions | |
UNIV_INTERN void | dict_stats_update_transient (dict_table_t *table) |
UNIV_INLINE void | dict_stats_set_persistent (dict_table_t *table, ibool ps_on, ibool ps_off)) |
UNIV_INLINE ibool | dict_stats_is_persistent_enabled (const dict_table_t *table)) |
UNIV_INLINE void | dict_stats_auto_recalc_set (dict_table_t *table, ibool auto_recalc_on, ibool auto_recalc_off) |
UNIV_INLINE ibool | dict_stats_auto_recalc_is_enabled (const dict_table_t *table) |
UNIV_INLINE void | dict_stats_init (dict_table_t *table) |
UNIV_INLINE void | dict_stats_deinit (dict_table_t *table)) |
UNIV_INTERN dberr_t | dict_stats_update (dict_table_t *table, dict_stats_upd_option_t stats_upd_option) |
UNIV_INTERN dberr_t | dict_stats_drop_index (const char *tname, const char *iname, char *errstr, ulint errstr_sz) |
UNIV_INTERN dberr_t | dict_stats_drop_table (const char *table_name, char *errstr, ulint errstr_sz) |
UNIV_INTERN void | dict_stats_update_for_index (dict_index_t *index)) |
UNIV_INTERN dberr_t | dict_stats_rename_table (const char *old_name, const char *new_name, char *errstr, size_t errstr_sz) |
Code used for calculating and manipulating table statistics.
Created Jan 06, 2010 Vasil Dimov
UNIV_INLINE ibool dict_stats_auto_recalc_is_enabled | ( | const dict_table_t * | table | ) |
Check whether auto recalc is enabled for a given table.
Check whether auto recalc is enabled for a given table.
table | in: table |
UNIV_INLINE void dict_stats_auto_recalc_set | ( | dict_table_t * | table, |
ibool | auto_recalc_on, | ||
ibool | auto_recalc_off | ||
) |
Set the auto recalc flag for a given table (only honored for a persistent stats enabled table). The flag is set only in the in-memory table object and is not saved in InnoDB files. It will be read from the .frm file upon first open from MySQL after a server restart. in: explicitly disabled
Set the auto recalc flag for a given table (only honored for a persistent stats enabled table). The flag is set only in the in-memory table object and is not saved in InnoDB files. It will be read from the .frm file upon first open from MySQL after a server restart.
table | in/out: table |
auto_recalc_on | in: explicitly enabled |
auto_recalc_off | in: explicitly disabled |
UNIV_INLINE void dict_stats_deinit | ( | dict_table_t * | table | ) |
Deinitialize table's stats after the last close of the table. This is used to detect "FLUSH TABLE" and refresh the stats upon next open.
table | in/out: table |
UNIV_INTERN dberr_t dict_stats_drop_index | ( | const char * | tname, |
const char * | iname, | ||
char * | errstr, | ||
ulint | errstr_sz | ||
) |
Removes the information for a particular index's stats from the persistent storage if it exists and if there is data stored for this index. This function creates its own trx and commits it.
tname | in: table name |
iname | in: index name |
errstr | out: error message if != DB_SUCCESS is returned |
UNIV_INTERN dberr_t dict_stats_drop_table | ( | const char * | table_name, |
char * | errstr, | ||
ulint | errstr_sz | ||
) |
Removes the statistics for a table and all of its indexes from the persistent storage if it exists and if there is data stored for the table. This function creates its own transaction and commits it.
table_name | in: table name |
errstr | out: error message if != DB_SUCCESS is returned |
UNIV_INLINE void dict_stats_init | ( | dict_table_t * | table | ) |
Initialize table's stats for the first time when opening a table. in/out: table
Initialize table's stats for the first time when opening a table.
table | in/out: table |
UNIV_INLINE ibool dict_stats_is_persistent_enabled | ( | const dict_table_t * | table | ) |
Check whether persistent statistics is enabled for a given table.
table | in: table |
UNIV_INTERN dberr_t dict_stats_rename_table | ( | const char * | old_name, |
const char * | new_name, | ||
char * | errstr, | ||
size_t | errstr_sz | ||
) |
Renames a table in InnoDB persistent stats storage. This function creates its own transaction and commits it.
old_name | in: old table name |
new_name | in: new table name |
errstr | out: error string if != DB_SUCCESS is returned |
UNIV_INLINE void dict_stats_set_persistent | ( | dict_table_t * | table, |
ibool | ps_on, | ||
ibool | ps_off | ||
) |
Set the persistent statistics flag for a given table. This is set only in the in-memory table object and is not saved on disk. It will be read from the .frm file upon first open from MySQL after a server restart.
table | in/out: table |
ps_on | in: persistent stats explicitly enabled |
ps_off | in: persistent stats explicitly disabled |
UNIV_INTERN dberr_t dict_stats_update | ( | dict_table_t * | table, |
dict_stats_upd_option_t | stats_upd_option | ||
) |
Calculates new estimates for table and index statistics. The statistics are used in query optimization.
table | in/out: table |
UNIV_INTERN void dict_stats_update_for_index | ( | dict_index_t * | index | ) |
Fetches or calculates new estimates for index statistics.
index | in/out: index |
UNIV_INTERN void dict_stats_update_transient | ( | dict_table_t * | table | ) |
Calculates new estimates for table and index statistics. This function is relatively quick and is used to calculate transient statistics that are not saved on disk. This was the only way to calculate statistics before the Persistent Statistics feature was introduced. in/out: table