24#ifndef DD_INFO_SCHEMA_TABLE_STATS_INCLUDED
25#define DD_INFO_SCHEMA_TABLE_STATS_INCLUDED
39namespace info_schema {
117 const char *partition_name) {
194 const String &index_name_ptr,
const char *partition_name,
195 const String &column_name_ptr, uint index_ordinal_position,
196 uint column_ordinal_position,
const String &engine_name_ptr,
198 const char *tbl_se_private_data,
const ulonglong &table_stat_data,
204 const String &engine_name_ptr,
const char *partition_name,
206 const char *tbl_se_private_data,
const ulonglong &table_stat_data,
209 return read_stat(thd, schema_name_ptr, table_name_ptr, tmp, partition_name,
210 tmp, 0, 0, engine_name_ptr, se_private_id,
211 ts_se_private_data, tbl_se_private_data, table_stat_data,
244 const char *partition_name,
295 const String &index_name_ptr,
const String &column_name_ptr,
296 uint index_ordinal_position, uint column_ordinal_position,
318 const String &table_name_ptr,
319 const String &index_name_ptr,
320 const char *partition_name,
321 const String &column_name_ptr,
322 uint column_ordinal_position,
334 const char *partition_name) {
352 const char *partition_name) {
354 (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:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
The class hold dynamic table statistics for a table.
Definition: table_stats.h:103
String_type m_error
Definition: table_stats.h:388
String_type m_key
Definition: table_stats.h:385
void cache_stats_in_mem(const String &db_name, const String &table_name, handler *file)
Definition: table_stats.h:141
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:243
bool is_valid() const
Predicate for determinig if cache is valid.
Definition: table_stats.h:381
bool m_read_stats_by_open
Definition: table_stats.h:400
ha_statistics m_stats
Definition: table_stats.h:404
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:333
bool is_stat_cached_in_mem(const String &db_name, const String &table_name)
Definition: table_stats.h:121
void cache_stats_in_mem(const String &db_name, const String &table_name, ha_statistics &stats)
Definition: table_stats.h:162
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:666
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:202
void set_checksum(ulonglong &&checksum)
Set checksum.
Definition: table_stats.h:371
ulonglong get_stat(enum_table_stats_type stype)
Definition: table_stats.h:366
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:133
void invalidate_cache(void)
Definition: table_stats.h:216
String_type error()
Definition: table_stats.h:222
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:444
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:116
ulonglong get_stat(ha_statistics &stat, enum_table_stats_type stype)
Return statistics of the a given type.
Definition: table_stats.cc:402
Table_statistics()
Definition: table_stats.h:105
ulonglong m_checksum
Definition: table_stats.h:391
void set_read_stats_by_open(bool status)
Set open table in progress.
Definition: table_stats.h:377
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:531
bool check_error_for_key(const String &db_name, const String &table_name)
Check if we have seen a error.
Definition: table_stats.h:261
ulonglong get_checksum() const
Get checksum.
Definition: table_stats.h:374
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:351
void set_stat_cached(const String &db_name, const String &table_name)
Definition: table_stats.h:338
bool is_reading_stats_by_open() const
Check if open table in progress.
Definition: table_stats.h:270
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:154
Definition: handler.h:4048
The handler class is the interface for dynamically loadable storage engines.
Definition: handler.h:4583
unsigned long long int ulonglong
Definition: my_inttypes.h:56
struct stats stats
Definition: mysqlslap.cc:238
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
enum_table_stats_type
Definition: table_stats.h:79
@ 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:318
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:389
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:344
The version of the current data dictionary table definitions.
Definition: dictionary_client.h:43
unsigned long long Object_id
Definition: object_id.h:31
Char_string_template< String_type_allocator > String_type
Definition: string_type.h:51
const char * table_name
Definition: rules_table_service.cc:56
const char * db_name
Definition: rules_table_service.cc:55
required uint32 status
Definition: replication_asynchronous_connection_failover.proto:61
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:2740
Definition: mysqlslap.cc:240