24#ifndef COMPONENTS_SERVICES_BITS_PSI_STATEMENT_BITS_H
25#define COMPONENTS_SERVICES_BITS_PSI_STATEMENT_BITS_H
27#ifndef MYSQL_ABI_CHECK
56#define PSI_STATEMENT_VERSION_1 1
63#define PSI_STATEMENT_VERSION_2 2
70#define PSI_STATEMENT_VERSION_3 3
77#define PSI_STATEMENT_VERSION_4 4
84#define PSI_STATEMENT_VERSION_5 5
91#define PSI_CURRENT_STATEMENT_VERSION 5
149#define PSI_SCHEMA_NAME_LEN (64 * 3)
152struct telemetry_session_t;
155struct telemetry_locker_t;
310 const char *db,
unsigned int db_length,
311 const char *src_file,
312 unsigned int src_line);
324 unsigned int text_len);
333 unsigned long long query_id);
341 unsigned long long lock_time);
349 unsigned long long count);
413 unsigned long count);
429 unsigned long count);
437 unsigned long count);
445 unsigned long count);
490 const char *stmt_name,
size_t stmt_name_length,
const char *sql_text,
491 size_t sql_text_length);
521 unsigned int text_len);
556 unsigned int object_type,
const char *schema_name,
557 unsigned int schema_name_length,
const char *object_name,
558 unsigned int object_name_length);
571typedef void (*
drop_sp_v1_t)(
unsigned int object_type,
const char *schema_name,
572 unsigned int schema_name_length,
573 const char *object_name,
574 unsigned int object_name_length);
struct PSI_digest_locker PSI_digest_locker
Definition: psi_statement_bits.h:112
unsigned int PSI_statement_key
Instrumented statement key.
Definition: psi_statement_bits.h:49
void(* destroy_prepared_stmt_v1_t)(PSI_prepared_stmt *prepared_stmt)
destroy a prepare statement.
Definition: psi_statement_bits.h:497
void(* inc_statement_sort_merge_passes_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "sort merge passes" metric.
Definition: psi_statement_bits.h:420
void(* inc_statement_sort_rows_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "sort rows" metric.
Definition: psi_statement_bits.h:436
void(* inc_statement_select_full_range_join_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "select full range join" metric.
Definition: psi_statement_bits.h:388
void(* set_statement_text_v1_t)(struct PSI_statement_locker *locker, const char *text, unsigned int text_len)
Set the statement text for a statement event.
Definition: psi_statement_bits.h:322
void(* inc_statement_select_range_check_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "select range check" metric.
Definition: psi_statement_bits.h:404
void(* inc_statement_select_scan_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "select scan" metric.
Definition: psi_statement_bits.h:412
void(* set_prepared_stmt_secondary_engine_v3_t)(PSI_prepared_stmt *prepared_stmt, bool secondary)
Set a prepared statement EXECUTION_ENGINE attribute.
Definition: psi_statement_bits.h:528
void(* register_statement_v1_t)(const char *category, struct PSI_statement_info_v1 *info, int count)
Statement registration API.
Definition: psi_statement_bits.h:275
void(* reprepare_prepared_stmt_v1_t)(PSI_prepared_stmt *prepared_stmt)
reprepare a prepare statement.
Definition: psi_statement_bits.h:503
void(* statement_abort_telemetry_v5_t)(PSI_statement_locker *locker)
Definition: psi_statement_bits.h:583
void(* inc_statement_sort_scan_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "sort scan" metric.
Definition: psi_statement_bits.h:444
void(* execute_prepared_stmt_v1_t)(PSI_statement_locker *locker, PSI_prepared_stmt *prepared_stmt)
Record a prepare statement instrumentation execute event.
Definition: psi_statement_bits.h:510
void(* set_statement_no_index_used_t)(struct PSI_statement_locker *locker)
Set a statement event "no index used" metric.
Definition: psi_statement_bits.h:451
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:105
void(* inc_statement_sort_range_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "sort range" metric.
Definition: psi_statement_bits.h:428
void(* start_statement_v1_t)(struct PSI_statement_locker *locker, const char *db, unsigned int db_length, const char *src_file, unsigned int src_line)
Start a new statement event.
Definition: psi_statement_bits.h:309
struct PSI_sp_locker PSI_sp_locker
Definition: psi_statement_bits.h:126
void(* release_sp_share_v1_t)(struct PSI_sp_share *share)
Release a stored program share.
Definition: psi_statement_bits.h:564
void(* set_statement_query_id_t)(struct PSI_statement_locker *locker, unsigned long long query_id)
Set a statement query id.
Definition: psi_statement_bits.h:332
void(* set_statement_secondary_engine_v3_t)(struct PSI_statement_locker *locker, bool secondary)
Set a statement EXECUTION_ENGINE attribute.
Definition: psi_statement_bits.h:466
void(* drop_sp_v1_t)(unsigned int object_type, const char *schema_name, unsigned int schema_name_length, const char *object_name, unsigned int object_name_length)
Definition: psi_statement_bits.h:571
void(* set_statement_rows_examined_t)(struct PSI_statement_locker *locker, unsigned long long count)
Set a statement event rows examined metric.
Definition: psi_statement_bits.h:356
void(* set_statement_no_good_index_used_t)(struct PSI_statement_locker *locker)
Set a statement event "no good index used" metric.
Definition: psi_statement_bits.h:458
#define PSI_SCHEMA_NAME_LEN
Definition: psi_statement_bits.h:149
struct PSI_sp_share PSI_sp_share
Definition: psi_statement_bits.h:119
void(* digest_end_v1_t)(struct PSI_digest_locker *locker, const struct sql_digest_storage *digest)
Add a computed digest to the current digest instrumentation.
Definition: psi_statement_bits.h:543
void(* inc_statement_select_range_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "select range join" metric.
Definition: psi_statement_bits.h:396
void(* set_prepared_stmt_text_v1_t)(PSI_prepared_stmt *prepared_stmt, const char *text, unsigned int text_len)
Set the statement text for a prepared statement event.
Definition: psi_statement_bits.h:519
void(* end_sp_v1_t)(struct PSI_sp_locker *locker)
Definition: psi_statement_bits.h:569
void(* inc_statement_select_full_join_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "select full join" metric.
Definition: psi_statement_bits.h:380
void(* end_statement_v1_t)(struct PSI_statement_locker *locker, void *stmt_da)
End a statement event.
Definition: psi_statement_bits.h:475
void(* set_statement_lock_time_t)(struct PSI_statement_locker *locker, unsigned long long lock_time)
Set a statement event lock time.
Definition: psi_statement_bits.h:340
void(* set_statement_rows_sent_t)(struct PSI_statement_locker *locker, unsigned long long count)
Set a statement event rows sent metric.
Definition: psi_statement_bits.h:348
void(* notify_statement_query_attributes_v5_t)(struct PSI_statement_locker *locker, bool with_query_attributes)
Definition: psi_statement_bits.h:580
struct PSI_statement_locker PSI_statement_locker
Definition: psi_statement_bits.h:98
void(* inc_statement_created_tmp_disk_tables_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "created tmp disk tables" metric.
Definition: psi_statement_bits.h:364
void(* inc_statement_created_tmp_tables_t)(struct PSI_statement_locker *locker, unsigned long count)
Increment a statement event "created tmp tables" metric.
Definition: psi_statement_bits.h:372
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:82
static int count
Definition: myisam_ftdump.cc:43
const std::string charset("charset")
static const char * category
Definition: sha2_password.cc:170
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Definition: psi_statement_bits.h:255
unsigned long long m_timer_start
Timer start.
Definition: psi_statement_bits.h:261
PSI_sp_share * m_sp_share
Stored Procedure share.
Definition: psi_statement_bits.h:265
unsigned long long(* m_timer)(void)
Timer function.
Definition: psi_statement_bits.h:263
unsigned int m_flags
Internal state.
Definition: psi_statement_bits.h:257
struct PSI_thread * m_thread
Current thread.
Definition: psi_statement_bits.h:259
Statement instrument information.
Definition: psi_statement_bits.h:133
const char * m_name
The name of the statement instrument to register.
Definition: psi_statement_bits.h:137
PSI_statement_key m_key
The registered statement key.
Definition: psi_statement_bits.h:135
const char * m_documentation
Documentation.
Definition: psi_statement_bits.h:144
unsigned int m_flags
The flags of the statement instrument to register.
Definition: psi_statement_bits.h:142
State data storage for get_thread_statement_locker_v5_t.
Definition: psi_statement_bits.h:166
unsigned long m_select_full_range_join
Metric, number of select full range join.
Definition: psi_statement_bits.h:212
unsigned long long m_timer_start
Timer start.
Definition: psi_statement_bits.h:186
unsigned char m_no_good_index_used
Metric, no good index used flag.
Definition: psi_statement_bits.h:174
unsigned int m_collect_flags
Internal state.
Definition: psi_statement_bits.h:176
unsigned int m_pfs_flags
Internal PFS flags.
Definition: psi_statement_bits.h:178
unsigned int m_schema_name_length
Length in bytes of m_schema_name.
Definition: psi_statement_bits.h:232
bool m_query_sample_truncated
True if m_query_sample was truncated.
Definition: psi_statement_bits.h:240
size_t m_controlled_stmt_size_start
State temporary data for MAX_CONTROLLED_MEMORY.
Definition: psi_statement_bits.h:192
unsigned long long m_rows_sent
Rows sent.
Definition: psi_statement_bits.h:202
size_t m_controlled_local_size_start
State temporary data for CONTROLLED_MEMORY.
Definition: psi_statement_bits.h:190
unsigned int m_cs_number
Statement character set number.
Definition: psi_statement_bits.h:234
void * m_statement
Internal data.
Definition: psi_statement_bits.h:198
unsigned long m_select_range
Metric, number of select range.
Definition: psi_statement_bits.h:214
unsigned long m_select_full_join
Metric, number of select full join.
Definition: psi_statement_bits.h:210
unsigned int m_tel_flags
Internal telemetry flags.
Definition: psi_statement_bits.h:180
size_t m_total_stmt_size_start
State temporary data for MAX_TOTAL_MEMORY.
Definition: psi_statement_bits.h:196
telemetry_locker_t * m_telemetry_locker
Definition: psi_statement_bits.h:251
unsigned long m_select_scan
Metric, number of select scan.
Definition: psi_statement_bits.h:218
uint64_t m_telemetry_scope
Telemetry can force instruments creation regardless if the respective consumer is enabled or not thro...
Definition: psi_statement_bits.h:247
char m_schema_name[PSI_SCHEMA_NAME_LEN]
Current schema name.
Definition: psi_statement_bits.h:230
unsigned char m_no_index_used
Metric, no index used flag.
Definition: psi_statement_bits.h:172
PSI_sp_share * m_parent_sp_share
Definition: psi_statement_bits.h:242
unsigned long m_created_tmp_disk_tables
Metric, temporary tables created on disk.
Definition: psi_statement_bits.h:206
size_t m_total_local_size_start
State temporary data for TOTAL_MEMORY.
Definition: psi_statement_bits.h:194
unsigned long m_sort_rows
Metric, number of sort rows.
Definition: psi_statement_bits.h:224
unsigned long m_created_tmp_tables
Metric, temporary tables created.
Definition: psi_statement_bits.h:208
bool m_in_prepare
In prepare flag.
Definition: psi_statement_bits.h:168
unsigned long long m_rows_examined
Rows examined.
Definition: psi_statement_bits.h:204
unsigned long m_sort_merge_passes
Metric, number of sort merge passes.
Definition: psi_statement_bits.h:220
const struct sql_digest_storage * m_digest
Statement digest.
Definition: psi_statement_bits.h:228
unsigned long long m_lock_time
Locked time.
Definition: psi_statement_bits.h:200
unsigned long m_sort_range
Metric, number of sort merge.
Definition: psi_statement_bits.h:222
bool m_secondary
Using secondary engine.
Definition: psi_statement_bits.h:170
const char * m_query_sample
Statement query sample.
Definition: psi_statement_bits.h:236
unsigned long m_select_range_check
Metric, number of select range check.
Definition: psi_statement_bits.h:216
PSI_prepared_stmt * m_parent_prepared_stmt
Definition: psi_statement_bits.h:243
void * m_telemetry
Definition: psi_statement_bits.h:249
unsigned long m_sort_scan
Metric, number of sort scans.
Definition: psi_statement_bits.h:226
telemetry_session_t * m_telemetry_session
Definition: psi_statement_bits.h:250
struct PSI_thread * m_thread
Current thread.
Definition: psi_statement_bits.h:184
unsigned long long m_cpu_time_start
THREAD CPU time start.
Definition: psi_statement_bits.h:188
unsigned int m_query_sample_length
Length in bytes of m_query_sample.
Definition: psi_statement_bits.h:238
void * m_class
Instrumentation class.
Definition: psi_statement_bits.h:182
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:98