MySQL 8.4.2
Source Code Documentation
table_esms_by_program.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef TABLE_ESMS_BY_PROGRAM_H
25#define TABLE_ESMS_BY_PROGRAM_H
26
27/**
28 @file storage/perfschema/table_esms_by_program.h
29 Table EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM (declarations).
30*/
31
32#include <sys/types.h>
33
36
37/**
38 @addtogroup performance_schema_tables
39 @{
40*/
41
43 public:
46 m_key_1("OBJECT_TYPE"),
47 m_key_2("OBJECT_SCHEMA"),
48 m_key_3("OBJECT_NAME") {}
49
50 ~PFS_index_esms_by_program() override = default;
51
52 virtual bool match(PFS_program *pfs);
53
54 private:
58};
59
60/**
61 A row of table
62 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
63*/
65 /** Column OBJECT_TYPE. */
67 /** Column OBJECT_SCHEMA. */
69 /** Column OBJECT_NAME. */
71
72 /**
73 Columns COUNT_STAR
74 SUM_TIMER_WAIT
75 MIN_TIMER_WAIT
76 AVG_TIMER_WAIT
77 MAX_TIMER_WAIT
78 */
80
81 /** Columns COUNT_STATEMENTS,SUM_STATEMENTS_WAIT...SUM_NO_GOOD_INDEX_USED. */
83};
84
85/** Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM. */
87 public:
88 /** Table share */
91 static int delete_all_rows();
92 static ha_rows get_row_count();
93
94 void reset_position() override;
95
96 int rnd_next() override;
97 int rnd_pos(const void *pos) override;
98
99 int index_init(uint idx, bool sorted) override;
100 int index_next() override;
101
102 protected:
103 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
104 bool read_all) override;
105
107
108 public:
109 ~table_esms_by_program() override = default;
110
111 protected:
112 int make_row(PFS_program *);
113
114 private:
115 /** Table share lock. */
117 /** Table definition. */
119
120 /** Current row. */
122 /** Current position. */
124 /** Next position. */
126
128};
129
130/** @} */
131#endif
Definition: field.h:575
Definition: pfs_engine_table.h:300
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_esms_by_program.h:42
PFS_key_object_type_enum m_key_1
Definition: table_esms_by_program.h:55
virtual bool match(PFS_program *pfs)
Definition: table_esms_by_program.cc:113
PFS_key_object_schema m_key_2
Definition: table_esms_by_program.h:56
PFS_index_esms_by_program()
Definition: table_esms_by_program.h:44
~PFS_index_esms_by_program() override=default
PFS_key_object_name m_key_3
Definition: table_esms_by_program.h:57
Definition: table_helper.h:1656
Definition: table_helper.h:1641
Definition: table_helper.h:1700
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
Definition: table_esms_by_program.h:86
PFS_index_esms_by_program * m_opened_index
Definition: table_esms_by_program.h:127
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_esms_by_program.cc:158
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_esms_by_program.cc:153
~table_esms_by_program() override=default
static THR_LOCK m_table_lock
Table share lock.
Definition: table_esms_by_program.h:116
table_esms_by_program()
Definition: table_esms_by_program.cc:148
PFS_simple_index m_pos
Current position.
Definition: table_esms_by_program.h:123
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_esms_by_program.cc:172
int make_row(PFS_program *)
Definition: table_esms_by_program.cc:214
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_esms_by_program.cc:235
static ha_rows get_row_count()
Definition: table_esms_by_program.cc:144
static int delete_all_rows()
Definition: table_esms_by_program.cc:139
int index_next() override
Find key in index, read record.
Definition: table_esms_by_program.cc:194
static Plugin_table m_table_def
Table definition.
Definition: table_esms_by_program.h:118
PFS_simple_index m_next_pos
Next position.
Definition: table_esms_by_program.h:125
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_esms_by_program.cc:135
int index_init(uint idx, bool sorted) override
Definition: table_esms_by_program.cc:185
row_esms_by_program m_row
Current row.
Definition: table_esms_by_program.h:121
static PFS_engine_table_share m_share
Table share.
Definition: table_esms_by_program.h:89
my_off_t ha_rows
Definition: my_base.h:1141
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:222
Stored Program data structures (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Definition: pfs_program.h:57
Definition: pfs_name.h:287
Definition: pfs_name.h:188
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Row fragment for stored program statistics.
Definition: table_helper.h:966
Row fragment for statement statistics columns.
Definition: table_helper.h:874
Definition: table.h:1406
Definition: thr_lock.h:139
A row of table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
Definition: table_esms_by_program.h:64
PFS_schema_name m_schema_name
Column OBJECT_SCHEMA.
Definition: table_esms_by_program.h:68
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_esms_by_program.h:66
PFS_statement_stat_row m_stmt_stat
Columns COUNT_STATEMENTS,SUM_STATEMENTS_WAIT...SUM_NO_GOOD_INDEX_USED.
Definition: table_esms_by_program.h:82
PFS_sp_stat_row m_sp_stat
Columns COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT.
Definition: table_esms_by_program.h:79
PFS_routine_name m_object_name
Column OBJECT_NAME.
Definition: table_esms_by_program.h:70
Helpers to implement a performance schema table.