88 bool auto_recalc_off);
147 const char *new_name,
159 const char *old_index_name,
160 const char *new_index_name);
249#ifdef UNIV_ENABLE_UNIT_TEST_DICT_STATS
250void test_dict_stats_all();
Represent the record of innodb_table_stats table.
Definition: dict0stats.h:163
ulint m_sum_of_other_index_sizes
Sum of other index size.
Definition: dict0stats.h:242
void set_db_name(const byte *data, ulint len)
Set the db name for the innodb_table_stats record.
Definition: dict0stats.cc:3530
void set_n_rows(uint64_t no_of_rows)
Set the n_rows for the innodb_table_stats record.
Definition: dict0stats.cc:3507
void set_clustered_index_size(ulint clust_size)
Set the clustered index size for the innodb_table_stats record.
Definition: dict0stats.cc:3515
char * m_tbl_name
Table name.
Definition: dict0stats.h:236
void set_data(const byte *data, ulint col_offset, ulint len)
Set the data for the innodb_table_stats record.
Definition: dict0stats.cc:3550
static constexpr unsigned CLUST_INDEX_SIZE_COL_NO
Column number of innodb_table_stats.clustered_index_size.
Definition: dict0stats.h:228
static constexpr unsigned DB_NAME_COL_NO
Column number of innodb_table_stats.database_name.
Definition: dict0stats.h:222
mem_heap_t * m_heap
Heap to store db_name, tbl_name for the record.
Definition: dict0stats.h:244
void set_tbl_name(const byte *data, ulint len)
Set the table name for the innodb_table_stats record.
Definition: dict0stats.cc:3541
ulint m_clustered_index_size
Clustered index size.
Definition: dict0stats.h:240
static constexpr unsigned TABLE_NAME_COL_NO
Column number of innodb_table_stats.table_name.
Definition: dict0stats.h:224
void set_sum_of_other_index_size(ulint sum_of_other_index_size)
Set the sum of sec index size.
Definition: dict0stats.cc:3523
static constexpr unsigned N_ROWS_COL_NO
Column number of innodb_table_stats.n_rows.
Definition: dict0stats.h:226
ulint get_sum_of_other_index_size() const
Get the sum of other index size.
Definition: dict0stats.cc:3519
char * get_db_name() const
Get the db name from the innodb_table_stats record.
Definition: dict0stats.cc:3528
TableStatsRecord()
Constructor.
Definition: dict0stats.cc:3497
~TableStatsRecord()
Destructor.
Definition: dict0stats.cc:3499
static constexpr unsigned SUM_OF_OTHER_INDEX_SIZE_COL_NO
Column number of innodb_table_stats.sum_of_other_index_sizes.
Definition: dict0stats.h:230
char * m_db_name
Database name.
Definition: dict0stats.h:234
char * get_tbl_name() const
Get the table name from innodb_table_stats record.
Definition: dict0stats.cc:3539
uint64_t m_n_rows
Number of rows.
Definition: dict0stats.h:238
uint64_t get_n_rows() const
Get the n_rows from the innodb_table_stats record.
Definition: dict0stats.cc:3505
ulint get_clustered_index_size() const
Get the clustered index size from innodb_table_stats record.
Definition: dict0stats.cc:3511
dberr_t
Definition: db0err.h:39
static bool dict_stats_auto_recalc_is_enabled(const dict_table_t *table)
Check whether auto recalc is enabled for a given table.
static void dict_stats_init(dict_table_t *table)
Initialize table's stats for the first time when opening a table.
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.
Definition: dict0stats.cc:3323
dict_stats_upd_option_t
Definition: dict0stats.h:43
@ DICT_STATS_RECALC_PERSISTENT
Definition: dict0stats.h:44
@ DICT_STATS_RECALC_TRANSIENT
Definition: dict0stats.h:50
@ DICT_STATS_FETCH_ONLY_IF_NOT_IN_MEMORY
Definition: dict0stats.h:59
@ DICT_STATS_EMPTY_TABLE
Definition: dict0stats.h:54
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 an...
Definition: dict0stats.cc:3169
dberr_t dict_stats_update_retry(dict_table_t *table, dict_stats_upd_option_t stats_upd_option, size_t max_retries)
Definition: dict0stats.cc:2840
void dict_stats_update_for_index(dict_index_t *index)
Fetches or calculates new estimates for index statistics.
Definition: dict0stats.cc:2819
static void dict_stats_auto_recalc_set(dict_table_t *table, bool auto_recalc_on, bool auto_recalc_off)
Set the auto recalc flag for a given table (only honored for a persistent stats enabled table).
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 i...
Definition: dict0stats.cc:3030
static bool dict_stats_is_persistent_enabled(const dict_table_t *table)
Check whether persistent statistics is enabled for a given table.
static void dict_stats_set_persistent(dict_table_t *table, bool ps_on, bool ps_off)
Set the persistent statistics flag for a given table.
dberr_t dict_stats_rename_index(const dict_table_t *table, const char *old_index_name, const char *new_index_name)
Renames an index in InnoDB persistent stats storage.
Definition: dict0stats.cc:3454
dberr_t dict_stats_update(dict_table_t *table, dict_stats_upd_option_t stats_upd_option, trx_t *trx=nullptr, bool silent=false)
Calculates new estimates for table and index statistics.
Definition: dict0stats.cc:2860
static void dict_stats_deinit(dict_table_t *table)
Deinitialize table's stats after the last close of the table.
Code used for calculating and manipulating table statistics.
Data dictionary global types.
static bool silent
Definition: mysqlimport.cc:70
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const char * table_name
Definition: rules_table_service.cc:56
Data structure for an index.
Definition: dict0mem.h:1041
Data structure for a database table.
Definition: dict0mem.h:1913
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:302
Definition: trx0trx.h:675
Transaction system global type definitions.
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406