23#ifndef COMPONENTS_SERVICES_BITS_PSI_STATEMENT_BITS_H
24#define COMPONENTS_SERVICES_BITS_PSI_STATEMENT_BITS_H
26#ifndef MYSQL_ABI_CHECK
55#define PSI_STATEMENT_VERSION_1 1
62#define PSI_STATEMENT_VERSION_2 2
69#define PSI_STATEMENT_VERSION_3 3
76#define PSI_STATEMENT_VERSION_4 4
83#define PSI_STATEMENT_VERSION_5 5
90#define PSI_CURRENT_STATEMENT_VERSION 5
148#define PSI_SCHEMA_NAME_LEN (64 * 3)
151struct telemetry_session_t;
154struct telemetry_locker_t;
309 const char *db,
unsigned int db_length,
310 const char *src_file,
311 unsigned int src_line);
323 unsigned int text_len);
332 unsigned long long query_id);
340 unsigned long long lock_time);
348 unsigned long long count);
412 unsigned long count);
428 unsigned long count);
436 unsigned long count);
444 unsigned long count);
489 const char *stmt_name,
size_t stmt_name_length,
const char *sql_text,
490 size_t sql_text_length);
520 unsigned int text_len);
555 unsigned int object_type,
const char *schema_name,
556 unsigned int schema_name_length,
const char *object_name,
557 unsigned int object_name_length);
570typedef void (*
drop_sp_v1_t)(
unsigned int object_type,
const char *schema_name,
571 unsigned int schema_name_length,
572 const char *object_name,
573 unsigned int object_name_length);
struct PSI_digest_locker PSI_digest_locker
Definition: psi_statement_bits.h:111
unsigned int PSI_statement_key
Instrumented statement key.
Definition: psi_statement_bits.h:48
void(* destroy_prepared_stmt_v1_t)(PSI_prepared_stmt *prepared_stmt)
destroy a prepare statement.
Definition: psi_statement_bits.h:496
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:419
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:435
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:387
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:321
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:403
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:411
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:527
void(* register_statement_v1_t)(const char *category, struct PSI_statement_info_v1 *info, int count)
Statement registration API.
Definition: psi_statement_bits.h:274
void(* reprepare_prepared_stmt_v1_t)(PSI_prepared_stmt *prepared_stmt)
reprepare a prepare statement.
Definition: psi_statement_bits.h:502
void(* statement_abort_telemetry_v5_t)(PSI_statement_locker *locker)
Definition: psi_statement_bits.h:582
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:443
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:509
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:450
struct PSI_prepared_stmt PSI_prepared_stmt
Definition: psi_statement_bits.h:104
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:427
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:308
struct PSI_sp_locker PSI_sp_locker
Definition: psi_statement_bits.h:125
void(* release_sp_share_v1_t)(struct PSI_sp_share *share)
Release a stored program share.
Definition: psi_statement_bits.h:563
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:331
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:465
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:570
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:355
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:457
#define PSI_SCHEMA_NAME_LEN
Definition: psi_statement_bits.h:148
struct PSI_sp_share PSI_sp_share
Definition: psi_statement_bits.h:118
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:542
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:395
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:518
void(* end_sp_v1_t)(struct PSI_sp_locker *locker)
Definition: psi_statement_bits.h:568
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:379
void(* end_statement_v1_t)(struct PSI_statement_locker *locker, void *stmt_da)
End a statement event.
Definition: psi_statement_bits.h:474
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:339
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:347
void(* notify_statement_query_attributes_v5_t)(struct PSI_statement_locker *locker, bool with_query_attributes)
Definition: psi_statement_bits.h:579
struct PSI_statement_locker PSI_statement_locker
Definition: psi_statement_bits.h:97
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:363
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:371
struct PSI_thread PSI_thread
Definition: psi_thread_bits.h:81
static int count
Definition: myisam_ftdump.cc:44
const std::string charset("charset")
static const char * category
Definition: sha2_password.cc:169
Performance schema instrumentation interface.
required string key
Definition: replication_asynchronous_connection_failover.proto:59
Definition: psi_statement_bits.h:254
unsigned long long m_timer_start
Timer start.
Definition: psi_statement_bits.h:260
PSI_sp_share * m_sp_share
Stored Procedure share.
Definition: psi_statement_bits.h:264
unsigned long long(* m_timer)(void)
Timer function.
Definition: psi_statement_bits.h:262
unsigned int m_flags
Internal state.
Definition: psi_statement_bits.h:256
struct PSI_thread * m_thread
Current thread.
Definition: psi_statement_bits.h:258
Statement instrument information.
Definition: psi_statement_bits.h:132
const char * m_name
The name of the statement instrument to register.
Definition: psi_statement_bits.h:136
PSI_statement_key m_key
The registered statement key.
Definition: psi_statement_bits.h:134
const char * m_documentation
Documentation.
Definition: psi_statement_bits.h:143
unsigned int m_flags
The flags of the statement instrument to register.
Definition: psi_statement_bits.h:141
State data storage for get_thread_statement_locker_v5_t.
Definition: psi_statement_bits.h:165
unsigned long m_select_full_range_join
Metric, number of select full range join.
Definition: psi_statement_bits.h:211
unsigned long long m_timer_start
Timer start.
Definition: psi_statement_bits.h:185
unsigned char m_no_good_index_used
Metric, no good index used flag.
Definition: psi_statement_bits.h:173
unsigned int m_collect_flags
Internal state.
Definition: psi_statement_bits.h:175
unsigned int m_pfs_flags
Internal PFS flags.
Definition: psi_statement_bits.h:177
unsigned int m_schema_name_length
Length in bytes of m_schema_name.
Definition: psi_statement_bits.h:231
bool m_query_sample_truncated
True if m_query_sample was truncated.
Definition: psi_statement_bits.h:239
size_t m_controlled_stmt_size_start
State temporary data for MAX_CONTROLLED_MEMORY.
Definition: psi_statement_bits.h:191
unsigned long long m_rows_sent
Rows sent.
Definition: psi_statement_bits.h:201
size_t m_controlled_local_size_start
State temporary data for CONTROLLED_MEMORY.
Definition: psi_statement_bits.h:189
unsigned int m_cs_number
Statement character set number.
Definition: psi_statement_bits.h:233
void * m_statement
Internal data.
Definition: psi_statement_bits.h:197
unsigned long m_select_range
Metric, number of select range.
Definition: psi_statement_bits.h:213
unsigned long m_select_full_join
Metric, number of select full join.
Definition: psi_statement_bits.h:209
unsigned int m_tel_flags
Internal telemetry flags.
Definition: psi_statement_bits.h:179
size_t m_total_stmt_size_start
State temporary data for MAX_TOTAL_MEMORY.
Definition: psi_statement_bits.h:195
telemetry_locker_t * m_telemetry_locker
Definition: psi_statement_bits.h:250
unsigned long m_select_scan
Metric, number of select scan.
Definition: psi_statement_bits.h:217
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:246
char m_schema_name[PSI_SCHEMA_NAME_LEN]
Current schema name.
Definition: psi_statement_bits.h:229
unsigned char m_no_index_used
Metric, no index used flag.
Definition: psi_statement_bits.h:171
PSI_sp_share * m_parent_sp_share
Definition: psi_statement_bits.h:241
unsigned long m_created_tmp_disk_tables
Metric, temporary tables created on disk.
Definition: psi_statement_bits.h:205
size_t m_total_local_size_start
State temporary data for TOTAL_MEMORY.
Definition: psi_statement_bits.h:193
unsigned long m_sort_rows
Metric, number of sort rows.
Definition: psi_statement_bits.h:223
unsigned long m_created_tmp_tables
Metric, temporary tables created.
Definition: psi_statement_bits.h:207
bool m_in_prepare
In prepare flag.
Definition: psi_statement_bits.h:167
unsigned long long m_rows_examined
Rows examined.
Definition: psi_statement_bits.h:203
unsigned long m_sort_merge_passes
Metric, number of sort merge passes.
Definition: psi_statement_bits.h:219
const struct sql_digest_storage * m_digest
Statement digest.
Definition: psi_statement_bits.h:227
unsigned long long m_lock_time
Locked time.
Definition: psi_statement_bits.h:199
unsigned long m_sort_range
Metric, number of sort merge.
Definition: psi_statement_bits.h:221
bool m_secondary
Using secondary engine.
Definition: psi_statement_bits.h:169
const char * m_query_sample
Statement query sample.
Definition: psi_statement_bits.h:235
unsigned long m_select_range_check
Metric, number of select range check.
Definition: psi_statement_bits.h:215
PSI_prepared_stmt * m_parent_prepared_stmt
Definition: psi_statement_bits.h:242
void * m_telemetry
Definition: psi_statement_bits.h:248
unsigned long m_sort_scan
Metric, number of sort scans.
Definition: psi_statement_bits.h:225
telemetry_session_t * m_telemetry_session
Definition: psi_statement_bits.h:249
struct PSI_thread * m_thread
Current thread.
Definition: psi_statement_bits.h:183
unsigned long long m_cpu_time_start
THREAD CPU time start.
Definition: psi_statement_bits.h:187
unsigned int m_query_sample_length
Length in bytes of m_query_sample.
Definition: psi_statement_bits.h:237
void * m_class
Instrumentation class.
Definition: psi_statement_bits.h:181
Structure to store token count/array for a statement on which digest is to be calculated.
Definition: sql_digest.h:97