MySQL 8.0.39
Source Code Documentation
table_esmh_global.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 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_ESMH_GLOBAL_H
26#define TABLE_ESMH_GLOBAL_H
27
28/**
29 @file storage/perfschema/table_esmh_global.h
30 Table EVENTS_STATEMENTS_HISTOGRAM_GLOBAL (declarations).
31*/
32
34
35/**
36 @addtogroup performance_schema_tables
37 @{
38*/
39
41 public:
43 : PFS_engine_index(&m_key_1), m_key_1("BUCKET_NUMBER") {}
44
45 ~PFS_index_esmh_global() override = default;
46
47 bool match_bucket(ulong bucket_index);
48
49 private:
51};
52
53/**
54 A row of table
55 PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_HISTOGRAM_GLOBAL.
56*/
57
59 /** Column BUCKET_NUMBER. */
61 /** Column COUNT_BUCKET_AND_LOWER. */
63};
64
66 /** Statistics for all buckets. */
68};
69
71 /** Column BUCKET_NUMBER. */
73 /** Column BUCKET_TIMER_LOW. */
75 /** Column BUCKET_TIMER_HIGH. */
77 /** Column COUNT_BUCKET. */
79 /** Column COUNT_BUCKET_AND_LOWER. */
81 /** Column BUCKET_QUANTILE. */
83};
84
85/** Table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_HISTOGRAM_GLOBAL. */
88
89 public:
90 /** Table share */
93 static int delete_all_rows();
94 static ha_rows get_row_count();
95
96 void reset_position() override;
97
98 int rnd_next() override;
99 int rnd_pos(const void *pos) override;
100
101 int index_init(uint idx, bool sorted) override;
102 int index_next() override;
103
104 protected:
105 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
106 bool read_all) override;
107
109
110 public:
111 ~table_esmh_global() override = default;
112
113 protected:
114 void materialize();
115 int make_row(ulong bucket_index);
116
117 private:
118 /** Table share lock. */
120 /** Table definition. */
122
123 /** Current row. */
126 /** Current position. */
128 /** Next position. */
130
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_esmh_global.h:40
bool match_bucket(ulong bucket_index)
Definition: table_esmh_global.cc:80
~PFS_index_esmh_global() override=default
PFS_key_bucket_number m_key_1
Definition: table_esmh_global.h:50
PFS_index_esmh_global()
Definition: table_esmh_global.h:42
Definition: table_helper.h:1525
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_HISTOGRAM_GLOBAL.
Definition: table_esmh_global.h:86
int make_row(ulong bucket_index)
Definition: table_esmh_global.cc:177
static THR_LOCK m_table_lock
Table share lock.
Definition: table_esmh_global.h:119
PFS_index_esmh_global * m_opened_index
Definition: table_esmh_global.h:131
static PFS_engine_table_share m_share
Table share.
Definition: table_esmh_global.h:91
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_esmh_global.cc:88
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_esmh_global.cc:112
void materialize()
Definition: table_esmh_global.cc:155
table_esmh_global()
Definition: table_esmh_global.cc:101
PFS_simple_index pos_t
Definition: table_esmh_global.h:87
~table_esmh_global() override=default
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_esmh_global.cc:107
static Plugin_table m_table_def
Table definition.
Definition: table_esmh_global.h:121
static ha_rows get_row_count()
Definition: table_esmh_global.cc:99
bool m_materialized
Definition: table_esmh_global.h:133
int index_init(uint idx, bool sorted) override
Definition: table_esmh_global.cc:133
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_esmh_global.cc:207
pos_t m_next_pos
Next position.
Definition: table_esmh_global.h:129
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_esmh_global.cc:123
row_esmh_global m_row
Definition: table_esmh_global.h:125
pos_t m_pos
Current position.
Definition: table_esmh_global.h:127
int index_next() override
Find key in index, read record.
Definition: table_esmh_global.cc:142
PFS_esmh_global_histogram m_materialized_histogram
Current row.
Definition: table_esmh_global.h:124
static int delete_all_rows()
Definition: table_esmh_global.cc:94
my_off_t ha_rows
Definition: my_base.h:1140
unsigned long long int ulonglong
Definition: my_inttypes.h:56
Definition: buf0block_hint.cc:30
#define NUMBER_OF_BUCKETS
Number of buckets used in histograms.
Definition: pfs_histogram.h:36
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:358
A row of table PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_HISTOGRAM_GLOBAL.
Definition: table_esmh_global.h:58
ulonglong m_count_bucket_and_lower
Column COUNT_BUCKET_AND_LOWER.
Definition: table_esmh_global.h:62
ulonglong m_count_bucket
Column BUCKET_NUMBER.
Definition: table_esmh_global.h:60
Definition: table_esmh_global.h:65
PFS_esmh_global_bucket m_buckets[NUMBER_OF_BUCKETS]
Statistics for all buckets.
Definition: table_esmh_global.h:67
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:566
Definition: table.h:1399
Definition: thr_lock.h:139
Definition: table_esmh_global.h:70
ulonglong m_bucket_timer_low
Column BUCKET_TIMER_LOW.
Definition: table_esmh_global.h:74
ulonglong m_count_bucket
Column COUNT_BUCKET.
Definition: table_esmh_global.h:78
ulong m_bucket_number
Column BUCKET_NUMBER.
Definition: table_esmh_global.h:72
ulonglong m_bucket_timer_high
Column BUCKET_TIMER_HIGH.
Definition: table_esmh_global.h:76
double m_percentile
Column BUCKET_QUANTILE.
Definition: table_esmh_global.h:82
ulonglong m_count_bucket_and_lower
Column COUNT_BUCKET_AND_LOWER.
Definition: table_esmh_global.h:80
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca9-dump.cc:75