23#ifndef DD_INFO_SCHEMA_TABLE_STATS_INCLUDED
24#define DD_INFO_SCHEMA_TABLE_STATS_INCLUDED
38namespace info_schema {
116 const char *partition_name) {
193 const String &index_name_ptr,
const char *partition_name,
194 const String &column_name_ptr, uint index_ordinal_position,
195 uint column_ordinal_position,
const String &engine_name_ptr,
197 const char *tbl_se_private_data,
const ulonglong &table_stat_data,
203 const String &engine_name_ptr,
const char *partition_name,
205 const char *tbl_se_private_data,
const ulonglong &table_stat_data,
208 return read_stat(thd, schema_name_ptr, table_name_ptr, tmp, partition_name,
209 tmp, 0, 0, engine_name_ptr, se_private_id,
210 ts_se_private_data, tbl_se_private_data, table_stat_data,
243 const char *partition_name,
294 const String &index_name_ptr,
const String &column_name_ptr,
295 uint index_ordinal_position, uint column_ordinal_position,
317 const String &table_name_ptr,
318 const String &index_name_ptr,
319 const char *partition_name,
320 const String &column_name_ptr,
321 uint column_ordinal_position,
333 const char *partition_name) {
351 const char *partition_name) {
353 (partition_name ? (
"." +
String_type(partition_name)) :
"");
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:166
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
The class hold dynamic table statistics for a table.
Definition: table_stats.h:102
String_type m_error
Definition: table_stats.h:387
String_type m_key
Definition: table_stats.h:384
void cache_stats_in_mem(const String &db_name, const String &table_name, handler *file)
Definition: table_stats.h:140
void store_error_message(const String &db_name, const String &table_name, const char *partition_name, const String_type &error_msg)
Set error string for the given key.
Definition: table_stats.h:242
bool is_valid() const
Predicate for determinig if cache is valid.
Definition: table_stats.h:380
bool m_read_stats_by_open
Definition: table_stats.h:399
ha_statistics m_stats
Definition: table_stats.h:403
void set_stat_cached(const String &db_name, const String &table_name, const char *partition_name)
Mark the cache as valid for a given table.
Definition: table_stats.h:332
bool is_stat_cached_in_mem(const String &db_name, const String &table_name)
Definition: table_stats.h:120
void cache_stats_in_mem(const String &db_name, const String &table_name, ha_statistics &stats)
Definition: table_stats.h:161
ulonglong read_stat_by_open_table(THD *thd, const String &schema_name_ptr, const String &table_name_ptr, const String &index_name_ptr, const char *partition_name, const String &column_name_ptr, uint column_ordinal_position, enum_table_stats_type stype)
Read dynamic table/index statistics by opening the table OR by reading cached statistics from Query_b...
Definition: table_stats.cc:665
ulonglong read_stat(THD *thd, const String &schema_name_ptr, const String &table_name_ptr, const String &engine_name_ptr, const char *partition_name, dd::Object_id se_private_id, const char *ts_se_private_data, const char *tbl_se_private_data, const ulonglong &table_stat_data, const ulonglong &cached_time, enum_table_stats_type stype)
Definition: table_stats.h:201
void set_checksum(ulonglong &&checksum)
Set checksum.
Definition: table_stats.h:370
ulonglong get_stat(enum_table_stats_type stype)
Definition: table_stats.h:365
void cache_stats_in_mem(const String &db_name, const String &table_name, const char *partition_name, handler *file)
Store the statistics form the given handler.
Definition: table_stats.h:132
void invalidate_cache(void)
Definition: table_stats.h:215
String_type error()
Definition: table_stats.h:221
ulonglong read_stat(THD *thd, const String &schema_name_ptr, const String &table_name_ptr, const String &index_name_ptr, const char *partition_name, const String &column_name_ptr, uint index_ordinal_position, uint column_ordinal_position, const String &engine_name_ptr, dd::Object_id se_private_id, const char *ts_se_private_data, const char *tbl_se_private_data, const ulonglong &table_stat_data, const ulonglong &cached_time, enum_table_stats_type stype)
Read dynamic table/index statistics from SE by opening the user table provided OR by reading cached s...
Definition: table_stats.cc:443
bool is_stat_cached_in_mem(const String &db_name, const String &table_name, const char *partition_name)
Check if the stats are cached for given db.table_name.
Definition: table_stats.h:115
ulonglong get_stat(ha_statistics &stat, enum_table_stats_type stype)
Return statistics of the a given type.
Definition: table_stats.cc:401
Table_statistics()
Definition: table_stats.h:104
ulonglong m_checksum
Definition: table_stats.h:390
void set_read_stats_by_open(bool status)
Set open table in progress.
Definition: table_stats.h:376
ulonglong read_stat_from_SE(THD *thd, const String &schema_name_ptr, const String &table_name_ptr, const String &index_name_ptr, const String &column_name_ptr, uint index_ordinal_position, uint column_ordinal_position, dd::Object_id se_private_id, const char *ts_se_private_data, const char *tbl_se_private_data, enum_table_stats_type stype, handlerton *hton)
Read dynamic table/index statistics from SE API's OR by reading cached statistics from Query_block.
Definition: table_stats.cc:530
bool check_error_for_key(const String &db_name, const String &table_name)
Check if we have seen a error.
Definition: table_stats.h:260
ulonglong get_checksum() const
Get checksum.
Definition: table_stats.h:373
String_type form_key(const String &db_name, const String &table_name, const char *partition_name)
Build a key representing the table for which stats are cached.
Definition: table_stats.h:350
void set_stat_cached(const String &db_name, const String &table_name)
Definition: table_stats.h:337
bool is_reading_stats_by_open() const
Check if open table in progress.
Definition: table_stats.h:269
void cache_stats_in_mem(const String &db_name, const String &table_name, const char *partition_name, ha_statistics &stats)
Store the statistics.
Definition: table_stats.h:153
Definition: handler.h:3964
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4501
unsigned long long int ulonglong
Definition: my_inttypes.h:55
struct stats stats
Definition: mysqlslap.cc:237
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
enum_table_stats_type
Definition: table_stats.h:78
@ INDEX_COLUMN_CARDINALITY
bool update_table_stats(THD *thd, Table_ref *table)
Get dynamic table statistics of a table and store them into mysql.table_stats.
Definition: table_stats.cc:317
bool convert_table_name_case(char *db, char *table_name)
If the db is 'information_schema' then convert 'db' to lowercase and 'table_name' to upper case.
Definition: table_stats.cc:388
bool update_index_stats(THD *thd, Table_ref *table)
Get dynamic index statistics of a table and store them into mysql.index_stats.
Definition: table_stats.cc:343
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:42
unsigned long long Object_id
Definition: object_id.h:30
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:50
const char * table_name
Definition: rules_table_service.cc:55
const char * db_name
Definition: rules_table_service.cc:54
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:60
Our own string classes, used pervasively throughout the executor.
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2692
Definition: mysqlslap.cc:239