MySQL 8.0.31
Source Code Documentation
dict0stats.ic File Reference

Code used for calculating and manipulating table statistics. More...

#include "dict0dict.h"
#include "dict0types.h"
#include "srv0srv.h"

Functions

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. More...
 
static bool dict_stats_is_persistent_enabled (const dict_table_t *table)
 Check whether persistent statistics is enabled for a given table. More...
 
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). More...
 
static bool dict_stats_auto_recalc_is_enabled (const dict_table_t *table)
 Check whether auto recalc is enabled for a given table. More...
 
static void dict_stats_init (dict_table_t *table)
 Initialize table's stats for the first time when opening a table. More...
 
static void dict_stats_deinit (dict_table_t *table)
 Deinitialize table's stats after the last close of the table. More...
 

Detailed Description

Code used for calculating and manipulating table statistics.

Created Jan 23, 2012 Vasil Dimov

Function Documentation

◆ dict_stats_auto_recalc_is_enabled()

static bool dict_stats_auto_recalc_is_enabled ( const dict_table_t table)
inlinestatic

Check whether auto recalc is enabled for a given table.

Returns
true if enabled, false otherwise
Parameters
tablein: table

◆ dict_stats_auto_recalc_set()

static void dict_stats_auto_recalc_set ( dict_table_t table,
bool  auto_recalc_on,
bool  auto_recalc_off 
)
inlinestatic

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.

Parameters
tablein/out: table
auto_recalc_onin: explicitly enabled
auto_recalc_offin: explicitly disabled

◆ dict_stats_deinit()

static void dict_stats_deinit ( dict_table_t table)
inlinestatic

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.

Parameters
tablein/out: table

◆ dict_stats_init()

static void dict_stats_init ( dict_table_t table)
inlinestatic

Initialize table's stats for the first time when opening a table.

Parameters
tablein/out: table

◆ dict_stats_is_persistent_enabled()

static bool dict_stats_is_persistent_enabled ( const dict_table_t table)
inlinestatic

Check whether persistent statistics is enabled for a given table.

Returns
true if enabled, false otherwise
Parameters
tablein: table

◆ dict_stats_set_persistent()

static void dict_stats_set_persistent ( dict_table_t table,
bool  ps_on,
bool  ps_off 
)
inlinestatic

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.

Parameters
tablein/out: table
ps_onin: persistent stats explicitly enabled
ps_offin: persistent stats explicitly disabled