MySQL 8.3.0
Source Code Documentation
table_esms_by_program.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2023, 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 also distributed 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 included with MySQL.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef TABLE_ESMS_BY_PROGRAM_H
24#define TABLE_ESMS_BY_PROGRAM_H
25
26/**
27 @file storage/perfschema/table_esms_by_program.h
28 Table EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM (declarations).
29*/
30
31#include <sys/types.h>
32
35
36/**
37 @addtogroup performance_schema_tables
38 @{
39*/
40
42 public:
45 m_key_1("OBJECT_TYPE"),
46 m_key_2("OBJECT_SCHEMA"),
47 m_key_3("OBJECT_NAME") {}
48
49 ~PFS_index_esms_by_program() override = default;
50
51 virtual bool match(PFS_program *pfs);
52
53 private:
57};
58
59/**
60 A row of table
61 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
62*/
64 /** Column OBJECT_TYPE. */
66 /** Column OBJECT_SCHEMA. */
68 /** Column OBJECT_NAME. */
70
71 /**
72 Columns COUNT_STAR
73 SUM_TIMER_WAIT
74 MIN_TIMER_WAIT
75 AVG_TIMER_WAIT
76 MAX_TIMER_WAIT
77 */
79
80 /** Columns COUNT_STATEMENTS,SUM_STATEMENTS_WAIT...SUM_NO_GOOD_INDEX_USED. */
82};
83
84/** Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM. */
86 public:
87 /** Table share */
90 static int delete_all_rows();
91 static ha_rows get_row_count();
92
93 void reset_position() override;
94
95 int rnd_next() override;
96 int rnd_pos(const void *pos) override;
97
98 int index_init(uint idx, bool sorted) override;
99 int index_next() override;
100
101 protected:
102 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
103 bool read_all) override;
104
106
107 public:
108 ~table_esms_by_program() override = default;
109
110 protected:
111 int make_row(PFS_program *);
112
113 private:
114 /** Table share lock. */
116 /** Table definition. */
118
119 /** Current row. */
121 /** Current position. */
123 /** Next position. */
125
127};
128
129/** @} */
130#endif
Definition: field.h:574
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_esms_by_program.h:41
PFS_key_object_type_enum m_key_1
Definition: table_esms_by_program.h:54
virtual bool match(PFS_program *pfs)
Definition: table_esms_by_program.cc:112
PFS_key_object_schema m_key_2
Definition: table_esms_by_program.h:55
PFS_index_esms_by_program()
Definition: table_esms_by_program.h:43
~PFS_index_esms_by_program() override=default
PFS_key_object_name m_key_3
Definition: table_esms_by_program.h:56
Definition: table_helper.h:1655
Definition: table_helper.h:1640
Definition: table_helper.h:1699
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
Definition: table_esms_by_program.h:85
PFS_index_esms_by_program * m_opened_index
Definition: table_esms_by_program.h:126
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_esms_by_program.cc:157
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_esms_by_program.cc:152
~table_esms_by_program() override=default
static THR_LOCK m_table_lock
Table share lock.
Definition: table_esms_by_program.h:115
table_esms_by_program()
Definition: table_esms_by_program.cc:147
PFS_simple_index m_pos
Current position.
Definition: table_esms_by_program.h:122
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_esms_by_program.cc:171
int make_row(PFS_program *)
Definition: table_esms_by_program.cc:213
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:234
static ha_rows get_row_count()
Definition: table_esms_by_program.cc:143
static int delete_all_rows()
Definition: table_esms_by_program.cc:138
int index_next() override
Find key in index, read record.
Definition: table_esms_by_program.cc:193
static Plugin_table m_table_def
Table definition.
Definition: table_esms_by_program.h:117
PFS_simple_index m_next_pos
Next position.
Definition: table_esms_by_program.h:124
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_esms_by_program.cc:134
int index_init(uint idx, bool sorted) override
Definition: table_esms_by_program.cc:184
row_esms_by_program m_row
Current row.
Definition: table_esms_by_program.h:120
static PFS_engine_table_share m_share
Table share.
Definition: table_esms_by_program.h:88
my_off_t ha_rows
Definition: my_base.h:1140
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Definition: buf0block_hint.cc:29
enum_object_type
Enum values for the various OBJECT_TYPE columns.
Definition: pfs_column_types.h:221
Stored Program data structures (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Definition: pfs_program.h:56
Definition: pfs_name.h:286
Definition: pfs_name.h:187
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:557
Row fragment for stored program statistics.
Definition: table_helper.h:965
Row fragment for statement statistics columns.
Definition: table_helper.h:873
Definition: table.h:1403
Definition: thr_lock.h:138
A row of table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_PROGRAM.
Definition: table_esms_by_program.h:63
PFS_schema_name m_schema_name
Column OBJECT_SCHEMA.
Definition: table_esms_by_program.h:67
enum_object_type m_object_type
Column OBJECT_TYPE.
Definition: table_esms_by_program.h:65
PFS_statement_stat_row m_stmt_stat
Columns COUNT_STATEMENTS,SUM_STATEMENTS_WAIT...SUM_NO_GOOD_INDEX_USED.
Definition: table_esms_by_program.h:81
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:78
PFS_routine_name m_object_name
Column OBJECT_NAME.
Definition: table_esms_by_program.h:69
Helpers to implement a performance schema table.