MySQL 8.1.0
Source Code Documentation
table_tiws_by_index_usage.h
Go to the documentation of this file.
1/* Copyright (c) 2010, 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#ifndef TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE_H
24#define TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE_H
25
26/**
27 @file storage/perfschema/table_tiws_by_index_usage.h
28 Table TABLE_IO_WAIT_SUMMARY_BY_INDEX_USAGE (declarations).
29*/
30
31#include <sys/types.h>
32
33#include "my_base.h"
36
37class Field;
38class Plugin_table;
39struct PFS_table_share;
40struct TABLE;
41struct THR_LOCK;
42
43/**
44 @addtogroup performance_schema_tables
45 @{
46*/
47
48/**
49 A row of table
50 PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
51*/
53 /** Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME. */
55 /** Columns COUNT/SUM/MIN/AVG/MAX (+_READ, +WRITE). */
57};
58
59/**
60 Position of a cursor on
61 PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
62 Index 1 on global_table_share_container (0 based)
63 Index 2 on index (0 based)
64*/
67
68 inline void reset() {
69 m_index_1 = 0;
70 m_index_2 = 0;
71 }
72
73 inline void next_table() {
74 m_index_1++;
75 m_index_2 = 0;
76 }
77};
78
80 public:
83 m_key_1("OBJECT_TYPE"),
84 m_key_2("OBJECT_SCHEMA"),
85 m_key_3("OBJECT_NAME"),
86 m_key_4("INDEX_NAME") {}
87
88 ~PFS_index_tiws_by_index_usage() override = default;
89
90 virtual bool match(PFS_table_share *pfs);
91 virtual bool match(PFS_table_share *share, uint index);
92
93 private:
97 PFS_key_object_name m_key_4; /* index name */
98};
99
100/** Table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX. */
102 public:
103 /** Table share */
106 static int delete_all_rows();
107 static ha_rows get_row_count();
108
109 void reset_position() override;
110
111 int rnd_init(bool scan) override;
112 int rnd_next() override;
113 int rnd_pos(const void *pos) override;
114
115 int index_init(uint idx, bool sorted) override;
116 int index_next() override;
117
118 protected:
119 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
120 bool read_all) override;
122
123 public:
124 ~table_tiws_by_index_usage() override = default;
125
126 protected:
127 int make_row(PFS_table_share *pfs_share, uint index);
128
129 private:
130 /** Table share lock. */
132 /** Table definition. */
134
135 /** Current row. */
137 /** Current position. */
139 /** Next position. */
141
142 protected:
144};
145
146/** @} */
147#endif
Definition: field.h:575
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_tiws_by_index_usage.h:79
PFS_key_object_name m_key_3
Definition: table_tiws_by_index_usage.h:96
virtual bool match(PFS_table_share *pfs)
Definition: table_tiws_by_index_usage.cc:115
PFS_key_object_type m_key_1
Definition: table_tiws_by_index_usage.h:94
PFS_key_object_name m_key_4
Definition: table_tiws_by_index_usage.h:97
~PFS_index_tiws_by_index_usage() override=default
PFS_key_object_schema m_key_2
Definition: table_tiws_by_index_usage.h:95
PFS_index_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.h:81
Definition: table_helper.h:1610
Definition: table_helper.h:1595
Definition: table_helper.h:1635
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:39
Table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:101
pos_tiws_by_index_usage m_next_pos
Next position.
Definition: table_tiws_by_index_usage.h:140
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_tiws_by_index_usage.cc:214
table_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.cc:176
static PFS_engine_table_share m_share
Table share.
Definition: table_tiws_by_index_usage.h:104
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_tiws_by_index_usage.cc:188
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_tiws_by_index_usage.cc:162
static int delete_all_rows()
Definition: table_tiws_by_index_usage.cc:166
static Plugin_table m_table_def
Table definition.
Definition: table_tiws_by_index_usage.h:133
~table_tiws_by_index_usage() override=default
pos_tiws_by_index_usage m_pos
Current position.
Definition: table_tiws_by_index_usage.h:138
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:131
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_tiws_by_index_usage.cc:186
row_tiws_by_index_usage m_row
Current row.
Definition: table_tiws_by_index_usage.h:136
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:181
int index_init(uint idx, bool sorted) override
Definition: table_tiws_by_index_usage.cc:233
static ha_rows get_row_count()
Definition: table_tiws_by_index_usage.cc:172
PFS_index_tiws_by_index_usage * m_opened_index
Definition: table_tiws_by_index_usage.h:143
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:1139
static PFS_engine_table_share_proxy table
Definition: pfs.cc:60
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
static const LEX_CSTRING pfs
Definition: sql_show_processlist.cc:65
Position of a double cursor, for iterations using 2 nested loops.
Definition: pfs_engine_table.h:592
uint m_index_1
Outer index.
Definition: pfs_engine_table.h:594
uint m_index_2
Current index within index_1.
Definition: pfs_engine_table.h:596
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_helper.h:644
Row fragment for table I/O statistics columns.
Definition: table_helper.h:735
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:404
Definition: table.h:1394
Definition: thr_lock.h:138
Position of a cursor on PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:65
pos_tiws_by_index_usage()
Definition: table_tiws_by_index_usage.h:66
void reset()
Definition: table_tiws_by_index_usage.h:68
void next_table()
Definition: table_tiws_by_index_usage.h:73
A row of table PERFORMANCE_SCHEMA.TABLE_IO_WAIT_SUMMARY_BY_INDEX.
Definition: table_tiws_by_index_usage.h:52
PFS_index_row m_index
Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME, INDEX_NAME.
Definition: table_tiws_by_index_usage.h:54
PFS_table_io_stat_row m_stat
Columns COUNT/SUM/MIN/AVG/MAX (+_READ, +WRITE).
Definition: table_tiws_by_index_usage.h:56
Helpers to implement a performance schema table.