MySQL 8.0.29
Source Code Documentation
table_tlws_by_table.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_LOCK_WAITS_SUMMARY_BY_TABLE_H
25#define TABLE_LOCK_WAITS_SUMMARY_BY_TABLE_H
26
27/**
28 @file storage/perfschema/table_tlws_by_table.h
29 Table TABLE_LOCK_WAITS_SUMMARY_BY_TABLE (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_LOCK_WAITS_SUMMARY_BY_TABLE.
52*/
54 /** Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
56 /** Columns COUNT/SUM/MIN/AVG/MAX READ/WRITE/READ_NORMAL/etc. */
58};
59
61 public:
64 m_key_1("OBJECT_TYPE"),
65 m_key_2("OBJECT_SCHEMA"),
66 m_key_3("OBJECT_NAME") {}
67
68 ~PFS_index_tlws_by_table() override = default;
69
70 virtual bool match(const PFS_table_share *table);
71
72 private:
76};
77
78/** Table PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE. */
80 public:
81 /** Table share */
84 static int delete_all_rows();
85 static ha_rows get_row_count();
86
87 void reset_position(void) override;
88
89 int rnd_init(bool scan) override;
90 int rnd_next() override;
91 int rnd_pos(const void *pos) override;
92
93 int index_init(uint idx, bool sorted) override;
94 int index_next() override;
95
96 protected:
97 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
98 bool read_all) override;
100
101 public:
102 ~table_tlws_by_table() override = default;
103
104 protected:
105 int make_row(PFS_table_share *table_share);
106
107 private:
108 /** Table share lock. */
110 /** Table definition. */
112
113 /** Current row. */
115 /** Current position. */
117 /** Next position. */
119
120 protected:
122};
123
124/** @} */
125#endif
Definition: field.h:573
Definition: pfs_engine_table.h:299
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:69
Definition: table_tlws_by_table.h:60
PFS_key_object_type m_key_1
Definition: table_tlws_by_table.h:73
PFS_key_object_schema m_key_2
Definition: table_tlws_by_table.h:74
virtual bool match(const PFS_table_share *table)
Definition: table_tlws_by_table.cc:143
~PFS_index_tlws_by_table() override=default
PFS_index_tlws_by_table()
Definition: table_tlws_by_table.h:62
PFS_key_object_name m_key_3
Definition: table_tlws_by_table.h:75
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_LOCK_WAITS_SUMMARY_BY_TABLE.
Definition: table_tlws_by_table.h:79
int index_next() override
Find key in index, read record.
Definition: table_tlws_by_table.cc:230
PFS_index_tlws_by_table * m_opened_index
Definition: table_tlws_by_table.h:121
table_tlws_by_table()
Definition: table_tlws_by_table.cc:179
row_tlws_by_table m_row
Current row.
Definition: table_tlws_by_table.h:114
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_tlws_by_table.cc:208
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_tlws_by_table.cc:189
PFS_simple_index m_next_pos
Next position.
Definition: table_tlws_by_table.h:118
int index_init(uint idx, bool sorted) override
Definition: table_tlws_by_table.cc:221
static THR_LOCK m_table_lock
Table share lock.
Definition: table_tlws_by_table.h:109
static int delete_all_rows()
Definition: table_tlws_by_table.cc:169
PFS_simple_index m_pos
Current position.
Definition: table_tlws_by_table.h:116
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_tlws_by_table.cc:165
static Plugin_table m_table_def
Table definition.
Definition: table_tlws_by_table.h:111
void reset_position(void) override
Reset the cursor position to the beginning of the table.
Definition: table_tlws_by_table.cc:184
static ha_rows get_row_count()
Definition: table_tlws_by_table.cc:175
~table_tlws_by_table() override=default
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_tlws_by_table.cc:191
int read_row_values(TABLE *table, unsigned char *buf, Field **fields, bool read_all) override
Read the current row values.
Definition: table_tlws_by_table.cc:271
int make_row(PFS_table_share *table_share)
Definition: table_tlws_by_table.cc:250
static PFS_engine_table_share m_share
Table share.
Definition: table_tlws_by_table.h:82
char * pos
Definition: do_ctype.cc:76
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1139
Definition: buf0block_hint.cc:29
Performance schema tables (declarations).
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:357
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:616
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:558
Row fragment for table lock statistics columns.
Definition: table_helper.h:786
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:387
Definition: table.h:1394
Definition: thr_lock.h:138
A row of table PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE.
Definition: table_tlws_by_table.h:53
PFS_object_row m_object
Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_tlws_by_table.h:55
PFS_table_lock_stat_row m_stat
Columns COUNT/SUM/MIN/AVG/MAX READ/WRITE/READ_NORMAL/etc.
Definition: table_tlws_by_table.h:57
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca-dump.cc:29