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