MySQL 9.1.0
Source Code Documentation
table_tiws_by_index_usage.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#ifndef TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE_H
25#define TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE_H
26
27/**
28 @file storage/perfschema/table_tiws_by_index_usage.h
29 Table TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE (declarations).
30*/
31
32#include <sys/types.h>
33
34#include "my_base.h"
37
38class Field;
39class Plugin_table;
40struct PFS_table_share;
41struct TABLE;
42struct THR_LOCK;
43
44/**
45 @addtogroup performance_schema_tables
46 @{
47*/
48
49/**
50 A row of table
51 PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
52*/
54 /** Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME. */
56 /** Columns COUNT/SUM/MIN/AVG/MAX (+_READ, +WRITE). */
58};
59
60/**
61 Position of a cursor on
62 PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
63 Index 1 on global_table_share_container (0 based)
64 Index 2 on index (0 based)
65*/
68
69 inline void reset() {
70 m_index_1 = 0;
71 m_index_2 = 0;
72 }
73
74 inline void next_table() {
75 m_index_1++;
76 m_index_2 = 0;
77 }
78};
79
81 public:
84 m_key_1("OBJECT_TYPE"),
85 m_key_2("OBJECT_SCHEMA"),
86 m_key_3("OBJECT_NAME"),
87 m_key_4("INDEX_NAME") {}
88
89 ~PFS_index_tiws_by_index_usage() override = default;
90
91 virtual bool match(PFS_table_share *pfs);
92 virtual bool match(PFS_table_share *share, uint index);
93
94 private:
98 PFS_key_object_name m_key_4; /* index name */
99};
100
101/** Table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX. */
103 public:
104 /** Table share */
107 static int delete_all_rows();
108 static ha_rows get_row_count();
109
110 void reset_position() override;
111
112 int rnd_init(bool scan) override;
113 int rnd_next() override;
114 int rnd_pos(const void *pos) override;
115
116 int index_init(uint idx, bool sorted) override;
117 int index_next() override;
118
119 protected:
120 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
121 bool read_all) override;
123
124 public:
125 ~table_tiws_by_index_usage() override = default;
126
127 protected:
128 int make_row(PFS_table_share *pfs_share, uint index);
129
130 private:
131 /** Table share lock. */
133 /** Table definition. */
135
136 /** Current row. */
138 /** Current position. */
140 /** Next position. */
142
143 protected:
145};
146
147/** @} */
148#endif
Definition: field.h:577
Definition: pfs_engine_table.h:301
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_tiws_by_index_usage.h:80
PFS_key_object_name m_key_3
Definition: table_tiws_by_index_usage.h:97
virtual bool match(PFS_table_share *pfs)
Definition: table_tiws_by_index_usage.cc:116
PFS_key_object_type m_key_1
Definition: table_tiws_by_index_usage.h:95
PFS_key_object_name m_key_4
Definition: table_tiws_by_index_usage.h:98
~PFS_index_tiws_by_index_usage() override=default
PFS_key_object_schema m_key_2
Definition: table_tiws_by_index_usage.h:96
PFS_index_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.h:82
Definition: table_helper.h:1671
Definition: table_helper.h:1656
Definition: table_helper.h:1696
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:102
pos_tiws_by_index_usage m_next_pos
Next position.
Definition: table_tiws_by_index_usage.h:141
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_tiws_by_index_usage.cc:215
table_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.cc:177
static PFS_engine_table_share m_share
Table share.
Definition: table_tiws_by_index_usage.h:105
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_tiws_by_index_usage.cc:189
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_tiws_by_index_usage.cc:163
static int delete_all_rows()
Definition: table_tiws_by_index_usage.cc:167
static Plugin_table m_table_def
Table definition.
Definition: table_tiws_by_index_usage.h:134
~table_tiws_by_index_usage() override=default
pos_tiws_by_index_usage m_pos
Current position.
Definition: table_tiws_by_index_usage.h:139
int make_row(PFS_table_share *pfs_share, uint index)
Definition: table_tiws_by_index_usage.cc:278
static THR_LOCK m_table_lock
Table share lock.
Definition: table_tiws_by_index_usage.h:132
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_tiws_by_index_usage.cc:187
row_tiws_by_index_usage m_row
Current row.
Definition: table_tiws_by_index_usage.h:137
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_tiws_by_index_usage.cc:312
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_tiws_by_index_usage.cc:182
int index_init(uint idx, bool sorted) override
Definition: table_tiws_by_index_usage.cc:234
static ha_rows get_row_count()
Definition: table_tiws_by_index_usage.cc:173
PFS_index_tiws_by_index_usage * m_opened_index
Definition: table_tiws_by_index_usage.h:144
int index_next() override
Find key in index, read record.
Definition: table_tiws_by_index_usage.cc:242
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1141
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:66
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:602
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:604
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:606
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:660
Row fragment for table I/O statistics columns.
Definition: table_helper.h:763
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:513
Definition: table.h:1421
Definition: thr_lock.h:139
Position of a cursor on PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:66
pos_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.h:67
void reset()
Definition: table_tiws_by_index_usage.h:69
void next_table()
Definition: table_tiws_by_index_usage.h:74
A row of table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:53
PFS_index_row m_index
Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_tiws_by_index_usage.h:55
PFS_table_io_stat_row m_stat
Columns COUNT/SUM/MIN/AVG/MAX (+_READ, +WRITE).
Definition: table_tiws_by_index_usage.h:57
Helpers to implement a performance schema table.