MySQL 8.3.0
Source Code Documentation
psi_statement_service.h
Go to the documentation of this file.
1/* Copyright (c) 2017, 2023, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef COMPONENTS_SERVICES_PSI_STATEMENT_SERVICE_H
24#define COMPONENTS_SERVICES_PSI_STATEMENT_SERVICE_H
25
28
29/*
30 Version 1.
31 Introduced in MySQL 8.0.3
32 Deprecated in MySQL 8.0.14
33 Obsoleted in MySQL 8.0.31
34 Status: Obsolete, use version 4 instead.
35*/
36
37/*
38 Version 2.
39 Introduced in MySQL 8.0.14
40 Deprecated in MySQL 8.0.28
41 Obsoleted in MySQL 8.0.31
42 Status: Obsolete, use version 4 instead.
43*/
44
45/*
46 Version 3.
47 Introduced in MySQL 8.0.28
48 Obsoleted in MySQL 8.0.31
49 Status: Obsolete, use version 4 instead.
50*/
51
52/*
53 Version 4.
54 Introduced in MySQL 8.0.31
55 Obsoleted in MySQL 8.0.33
56 Status: Obsolete, use version 5 instead.
57 Changes compared to version 3:
58 - get_thread_statement_locker_v4_t,
59 the state structure is bigger.
60*/
61
62/*
63 Version 5.
64 Introduced in MySQL 8.0.33
65 Status: active.
66 Changes compared to version 4:
67 - get_thread_statement_locker_v5_t
68 (the state structure is bigger),
69 notify_statement_query_attributes_v5_t,
70 statement_abort_telemetry_v5_t.
71*/
72BEGIN_SERVICE_DEFINITION(psi_statement_v5)
73/** @sa register_statement_v1_t. */
74register_statement_v1_t register_statement;
75/** @sa get_thread_statement_locker_v1_t. */
76get_thread_statement_locker_v5_t get_thread_statement_locker;
77/** @sa refine_statement_v1_t. */
78refine_statement_v1_t refine_statement;
79/** @sa start_statement_v1_t. */
80start_statement_v1_t start_statement;
81/** @sa set_statement_text_v1_t. */
82set_statement_text_v1_t set_statement_text;
83/** @sa set_statement_query_id_t. */
84set_statement_query_id_t set_statement_query_id;
85/** @sa set_statement_lock_time_t. */
86set_statement_lock_time_t set_statement_lock_time;
87/** @sa set_statement_rows_sent_t. */
88set_statement_rows_sent_t set_statement_rows_sent;
89/** @sa set_statement_rows_examined_t. */
90set_statement_rows_examined_t set_statement_rows_examined;
91/** @sa inc_statement_created_tmp_disk_tables. */
92inc_statement_created_tmp_disk_tables_t inc_statement_created_tmp_disk_tables;
93/** @sa inc_statement_created_tmp_tables. */
94inc_statement_created_tmp_tables_t inc_statement_created_tmp_tables;
95/** @sa inc_statement_select_full_join. */
96inc_statement_select_full_join_t inc_statement_select_full_join;
97/** @sa inc_statement_select_full_range_join. */
98inc_statement_select_full_range_join_t inc_statement_select_full_range_join;
99/** @sa inc_statement_select_range. */
100inc_statement_select_range_t inc_statement_select_range;
101/** @sa inc_statement_select_range_check. */
102inc_statement_select_range_check_t inc_statement_select_range_check;
103/** @sa inc_statement_select_scan. */
104inc_statement_select_scan_t inc_statement_select_scan;
105/** @sa inc_statement_sort_merge_passes. */
106inc_statement_sort_merge_passes_t inc_statement_sort_merge_passes;
107/** @sa inc_statement_sort_range. */
108inc_statement_sort_range_t inc_statement_sort_range;
109/** @sa inc_statement_sort_rows. */
110inc_statement_sort_rows_t inc_statement_sort_rows;
111/** @sa inc_statement_sort_scan. */
112inc_statement_sort_scan_t inc_statement_sort_scan;
113/** @sa set_statement_no_index_used. */
114set_statement_no_index_used_t set_statement_no_index_used;
115/** @sa set_statement_no_good_index_used. */
116set_statement_no_good_index_used_t set_statement_no_good_index_used;
117/** @sa set_statement_secondary_engine_v3_t. */
118set_statement_secondary_engine_v3_t set_statement_secondary_engine;
119/** @sa end_statement_v1_t. */
120end_statement_v1_t end_statement;
121
122/** @sa create_prepared_stmt_v1_t. */
124/** @sa destroy_prepared_stmt_v1_t. */
125destroy_prepared_stmt_v1_t destroy_prepared_stmt;
126/** @sa reprepare_prepared_stmt_v1_t. */
127reprepare_prepared_stmt_v1_t reprepare_prepared_stmt;
128/** @sa execute_prepared_stmt_v1_t. */
129execute_prepared_stmt_v1_t execute_prepared_stmt;
130/** @sa set_prepared_stmt_text_v1_t. */
131set_prepared_stmt_text_v1_t set_prepared_stmt_text;
132/** @sa set_prepared_stmt_secondary_engine_v3_t */
133set_prepared_stmt_secondary_engine_v3_t set_prepared_stmt_secondary_engine;
134
135/** @sa digest_start_v1_t. */
136digest_start_v1_t digest_start;
137/** @sa digest_end_v1_t. */
139
140/** @sa get_sp_share_v1_t. */
141get_sp_share_v1_t get_sp_share;
142/** @sa release_sp_share_v1_t. */
143release_sp_share_v1_t release_sp_share;
144/** @sa start_sp_v1_t. */
146/** @sa start_sp_v1_t. */
148/** @sa drop_sp_v1_t. */
150
151notify_statement_query_attributes_v5_t notify_statement_query_attributes;
152statement_abort_telemetry_v5_t statement_abort_telemetry;
153END_SERVICE_DEFINITION(psi_statement_v5)
154
155#endif /* COMPONENTS_SERVICES_PSI_STATEMENT_SERVICE_H */
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
struct PSI_digest_locker *(* digest_start_v1_t)(struct PSI_statement_locker *locker)
Get a digest locker for the current statement.
Definition: psi_statement_bits.h:534
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
struct PSI_statement_locker *(* get_thread_statement_locker_v5_t)(struct PSI_statement_locker_state_v5 *state, PSI_statement_key key, const void *charset, PSI_sp_share *sp_share)
Get a statement instrumentation locker.
Definition: psi_statement_bits.h:286
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_sp_share *(* get_sp_share_v1_t)(unsigned int object_type, const char *schema_name, unsigned int schema_name_length, const char *object_name, unsigned int object_name_length)
Acquire a sp share instrumentation.
Definition: psi_statement_bits.h:554
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
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
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 *(* refine_statement_v1_t)(struct PSI_statement_locker *locker, PSI_statement_key key)
Refine a statement locker to a more specific key.
Definition: psi_statement_bits.h:297
PSI_prepared_stmt *(* create_prepared_stmt_v1_t)(void *identity, unsigned int stmt_id, PSI_statement_locker *locker, const char *stmt_name, size_t stmt_name_length, const char *sql_text, size_t sql_text_length)
Get a prepare statement.
Definition: psi_statement_bits.h:487
PSI_sp_locker *(* start_sp_v1_t)(struct PSI_sp_locker_state_v1 *state, struct PSI_sp_share *sp_share)
Definition: psi_statement_bits.h:565
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
PFS_prepared_stmt * create_prepared_stmt(void *identity, PFS_thread *thread, PFS_program *pfs_program, PFS_events_statements *pfs_stmt, uint stmt_id, const char *stmt_name, uint stmt_name_length, const char *sqltext, uint sqltext_length)
Definition: pfs_prepared_stmt.cc:72
Performance schema instrumentation interface.
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85