MySQL 8.0.39
Source Code Documentation
table_esms_by_digest.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 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
25#ifndef TABLE_ESMS_BY_DIGEST_H
26#define TABLE_ESMS_BY_DIGEST_H
27
28/**
29 @file storage/perfschema/table_esms_by_digest.h
30 Table EVENTS_STATEMENTS_SUMMARY_BY_DIGEST (declarations).
31*/
32
33#include <sys/types.h>
34
35#include "my_inttypes.h"
38
39/**
40 @addtogroup performance_schema_tables
41 @{
42*/
43
45 public:
48 m_key_1("SCHEMA_NAME"),
49 m_key_2("DIGEST") {}
50
51 ~PFS_index_esms_by_digest() override = default;
52
54
55 private:
58};
59
60/**
61 A row of table
62 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.
63*/
65 /** Columns DIGEST/DIGEST_TEXT. */
67
68 /** Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT. */
70
71 /** Column FIRST_SEEN. */
73 /** Column LAST_SEEN. */
75
76 /** Column QUANTILE_95. */
78 /** Column QUANTILE_99. */
80 /** Column QUANTILE_999. */
82
83 /** Column QUERY_SAMPLE_TEXT. */
85 /** Column QUERY_SAMPLE_SEEN. */
87 /** Column QUERY_SAMPLE_TIMER_WAIT. */
89};
90
91/** Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_DIGEST. */
93 public:
94 /** Table share */
97 static int delete_all_rows();
98 static ha_rows get_row_count();
99
100 void reset_position() override;
101
102 int rnd_next() override;
103 int rnd_pos(const void *pos) override;
104
105 int index_init(uint idx, bool sorted) override;
106 int index_next() override;
107
108 protected:
109 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
110 bool read_all) override;
111
113
114 public:
115 ~table_esms_by_digest() override = default;
116
117 protected:
119
120 private:
121 /** Table share lock. */
123 /** Table definition. */
125
126 /** Current row. */
128 /** Current position. */
130 /** Next position. */
132
134};
135
136/** @} */
137#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_digest.h:44
PFS_key_digest m_key_2
Definition: table_esms_by_digest.h:57
PFS_key_schema m_key_1
Definition: table_esms_by_digest.h:56
virtual bool match(PFS_statements_digest_stat *pfs)
Definition: table_esms_by_digest.cc:116
~PFS_index_esms_by_digest() override=default
PFS_index_esms_by_digest()
Definition: table_esms_by_digest.h:46
Definition: table_helper.h:1516
Definition: table_helper.h:1507
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.
Definition: table_esms_by_digest.h:92
static Plugin_table m_table_def
Table definition.
Definition: table_esms_by_digest.h:124
~table_esms_by_digest() override=default
PFS_simple_index m_next_pos
Next position.
Definition: table_esms_by_digest.h:131
static PFS_engine_table_share m_share
Table share.
Definition: table_esms_by_digest.h:95
int index_next() override
Find key in index, read record.
Definition: table_esms_by_digest.cc:198
static THR_LOCK m_table_lock
Table share lock.
Definition: table_esms_by_digest.h:122
table_esms_by_digest()
Definition: table_esms_by_digest.cc:140
static int delete_all_rows()
Definition: table_esms_by_digest.cc:133
static ha_rows get_row_count()
Definition: table_esms_by_digest.cc:138
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_esms_by_digest.cc:170
PFS_index_esms_by_digest * m_opened_index
Definition: table_esms_by_digest.h:133
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_esms_by_digest.cc:150
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_esms_by_digest.cc:129
row_esms_by_digest m_row
Current row.
Definition: table_esms_by_digest.h:127
int index_init(uint idx, bool sorted) override
Definition: table_esms_by_digest.cc:189
int make_row(PFS_statements_digest_stat *)
Definition: table_esms_by_digest.cc:220
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_esms_by_digest.cc:299
PFS_simple_index m_pos
Current position.
Definition: table_esms_by_digest.h:129
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_esms_by_digest.cc:145
my_off_t ha_rows
Definition: my_base.h:1140
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: buf0block_hint.cc:30
Statement Digest data structures (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Row fragment for columns DIGEST, DIGEST_TEXT.
Definition: table_helper.h:565
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Row fragment for statement statistics columns.
Definition: table_helper.h:873
A statement digest stat record.
Definition: pfs_digest.h:59
Definition: table.h:1399
Definition: thr_lock.h:139
A row of table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_DIGEST.
Definition: table_esms_by_digest.h:64
ulonglong m_p999
Column QUANTILE_999.
Definition: table_esms_by_digest.h:81
ulonglong m_p95
Column QUANTILE_95.
Definition: table_esms_by_digest.h:77
String m_query_sample
Column QUERY_SAMPLE_TEXT.
Definition: table_esms_by_digest.h:84
ulonglong m_first_seen
Column FIRST_SEEN.
Definition: table_esms_by_digest.h:72
ulonglong m_last_seen
Column LAST_SEEN.
Definition: table_esms_by_digest.h:74
PFS_digest_row m_digest
Columns DIGEST/DIGEST_TEXT.
Definition: table_esms_by_digest.h:66
ulonglong m_p99
Column QUANTILE_99.
Definition: table_esms_by_digest.h:79
ulonglong m_query_sample_seen
Column QUERY_SAMPLE_SEEN.
Definition: table_esms_by_digest.h:86
PFS_statement_stat_row m_stat
Columns COUNT_STAR, SUM/MIN/AVG/MAX TIMER_WAIT.
Definition: table_esms_by_digest.h:69
ulonglong m_query_sample_timer_wait
Column QUERY_SAMPLE_TIMER_WAIT.
Definition: table_esms_by_digest.h:88
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca9-dump.cc:75