MySQL 9.0.0
Source Code Documentation
|
The class hold dynamic table statistics for a table. More...
#include <tablespace_stats.h>
Public Member Functions | |
Tablespace_statistics () | |
bool | is_stat_cached (const String &tablespace_name, const String &file_name) |
Check if the stats are cached for given tablespace_name and file_name. More... | |
void | cache_stats (const String &tablespace_name, const String &file_name, ha_tablespace_statistics &stats) |
Store the statistics form the given handler. More... | |
bool | read_stat (THD *thd, const String &tablespace_name_ptr, const String &file_name_ptr, const String &engine_name_ptr, const char *ts_se_private_data) |
Read dynamic tablespace statistics from SE API OR by reading cached statistics from Query_block. More... | |
void | invalidate_cache (void) |
void | mark_as_error_found (const String &tablespace_name, const String &file_name) |
Mark that error was found for the given key. More... | |
void | get_stat (enum_tablespace_stats_type stype, ulonglong *result) |
Return statistics of the a given type. More... | |
void | get_stat (enum_tablespace_stats_type stype, dd::String_type *result) |
bool | is_valid () const |
Predicate for determinig if cache is valid. More... | |
Public Attributes | |
ha_tablespace_statistics | m_stats |
Private Member Functions | |
void | set_stat_cached (const String &tablespace_name, const String &file_name) |
Mark the cache as valid for a given table. More... | |
String_type | form_key (const String &tablespace_name, const String &file_name) |
Build a key representing the table for which stats are cached. More... | |
bool | check_error_for_key (const String &tablespace_name, const String &file_name) |
Check if we have seen a error. More... | |
bool | read_stat_from_SE (THD *thd, const String &tablespace_name_ptr, const String &file_name_ptr, const String &engine_name_ptr, const char *ts_se_private_data) |
Read dynamic tablespace statistics from SE API. More... | |
Private Attributes | |
String_type | m_key |
bool | m_found_error |
The class hold dynamic table statistics for a table.
This cache is used by internal UDF's defined for the purpose of INFORMATION_SCHEMA queries which retrieve dynamic table statistics. The class caches statistics for just one table.
Overall aim of introducing this cache is to avoid making multiple calls to same SE API to retrieve the statistics.
|
inline |
|
inline |
Store the statistics form the given handler.
tablespace_name | - Tablespace name. |
file_name | - File name. |
stats | - ha_tablespace_statistics. |
|
inlineprivate |
Check if we have seen a error.
tablespace_name | - Tablespace name. |
file_name | - File name. |
|
inlineprivate |
Build a key representing the table for which stats are cached.
tablespace_name | - Tablespace name. |
file_name | - File name. |
void dd::info_schema::Tablespace_statistics::get_stat | ( | enum_tablespace_stats_type | stype, |
dd::String_type * | result | ||
) |
void dd::info_schema::Tablespace_statistics::get_stat | ( | enum_tablespace_stats_type | stype, |
ulonglong * | result | ||
) |
Return statistics of the a given type.
stype | Type of statistics requested. | |
[out] | result | Value for stype. |
|
inline |
|
inline |
Check if the stats are cached for given tablespace_name and file_name.
tablespace_name | - Tablespace name. |
file_name | - File name. |
|
inline |
Predicate for determinig if cache is valid.
|
inline |
Mark that error was found for the given key.
The combination of tablespace and file name forms the key.
tablespace_name | - Tablespace name. |
file_name | - File name. |
bool dd::info_schema::Tablespace_statistics::read_stat | ( | THD * | thd, |
const String & | tablespace_name_ptr, | ||
const String & | file_name_ptr, | ||
const String & | engine_name_ptr, | ||
const char * | ts_se_private_data | ||
) |
Read dynamic tablespace statistics from SE API OR by reading cached statistics from Query_block.
thd | - Current thread. |
tablespace_name_ptr | - Tablespace name of which we need stats. |
file_name_ptr | - File name. |
engine_name_ptr | - Engine name. |
ts_se_private_data | - Tablespace se private data. |
|
private |
Read dynamic tablespace statistics from SE API.
thd | - Current thread. |
tablespace_name_ptr | - Tablespace name of which we need stats. |
file_name_ptr | - File name. |
engine_name_ptr | - Engine name. |
ts_se_private_data | - Tablespace se private data. |
|
inlineprivate |
Mark the cache as valid for a given table.
This creates a key for the cache element. We store just a single table statistics in this cache.
tablespace_name | - Tablespace name. |
file_name | - File name. |
|
private |
|
private |
ha_tablespace_statistics dd::info_schema::Tablespace_statistics::m_stats |