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