MySQL 8.0.40
Source Code Documentation
table_tlws_by_table.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
25#ifndef TABLE_LOCK_WAITS_SUMMARY_BY_TABLE_H
26#define TABLE_LOCK_WAITS_SUMMARY_BY_TABLE_H
27
28/**
29 @file storage/perfschema/table_tlws_by_table.h
30 Table TABLE_LOCK_WAITS_SUMMARY_BY_TABLE (declarations).
31*/
32
33#include <sys/types.h>
34
35#include "my_base.h"
38
39class Field;
40class Plugin_table;
41struct PFS_table_share;
42struct TABLE;
43struct THR_LOCK;
44
45/**
46 @addtogroup performance_schema_tables
47 @{
48*/
49
50/**
51 A row of table
52 PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE.
53*/
55 /** Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME. */
57 /** Columns COUNT/SUM/MIN/AVG/MAX READ/WRITE/READ_NORMAL/etc. */
59};
60
62 public:
65 m_key_1("OBJECT_TYPE"),
66 m_key_2("OBJECT_SCHEMA"),
67 m_key_3("OBJECT_NAME") {}
68
69 ~PFS_index_tlws_by_table() override = default;
70
71 virtual bool match(const PFS_table_share *share);
72
73 private:
77};
78
79/** Table PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE. */
81 public:
82 /** Table share */
85 static int delete_all_rows();
86 static ha_rows get_row_count();
87
88 void reset_position() override;
89
90 int rnd_init(bool scan) override;
91 int rnd_next() override;
92 int rnd_pos(const void *pos) override;
93
94 int index_init(uint idx, bool sorted) override;
95 int index_next() override;
96
97 protected:
98 int read_row_values(TABLE *table, unsigned char *buf, Field **fields,
99 bool read_all) override;
101
102 public:
103 ~table_tlws_by_table() override = default;
104
105 protected:
106 int make_row(PFS_table_share *table_share);
107
108 private:
109 /** Table share lock. */
111 /** Table definition. */
113
114 /** Current row. */
116 /** Current position. */
118 /** Next position. */
120
121 protected:
123};
124
125/** @} */
126#endif
Definition: field.h:575
Definition: pfs_engine_table.h:301
An abstract PERFORMANCE_SCHEMA table.
Definition: pfs_engine_table.h:70
Definition: table_tlws_by_table.h:61
PFS_key_object_type m_key_1
Definition: table_tlws_by_table.h:74
PFS_key_object_schema m_key_2
Definition: table_tlws_by_table.h:75
~PFS_index_tlws_by_table() override=default
PFS_index_tlws_by_table()
Definition: table_tlws_by_table.h:63
virtual bool match(const PFS_table_share *share)
Definition: table_tlws_by_table.cc:144
PFS_key_object_name m_key_3
Definition: table_tlws_by_table.h:76
Definition: table_helper.h:1650
Definition: table_helper.h:1635
Definition: table_helper.h:1675
Class to hold information regarding a table to be created on behalf of a plugin.
Definition: plugin_table.h:40
Table PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE.
Definition: table_tlws_by_table.h:80
int index_next() override
Find key in index, read record.
Definition: table_tlws_by_table.cc:231
PFS_index_tlws_by_table * m_opened_index
Definition: table_tlws_by_table.h:122
table_tlws_by_table()
Definition: table_tlws_by_table.cc:180
row_tlws_by_table m_row
Current row.
Definition: table_tlws_by_table.h:115
int rnd_pos(const void *pos) override
Fetch a row by position.
Definition: table_tlws_by_table.cc:209
int rnd_init(bool scan) override
Initialize table scan.
Definition: table_tlws_by_table.cc:190
PFS_simple_index m_next_pos
Next position.
Definition: table_tlws_by_table.h:119
int index_init(uint idx, bool sorted) override
Definition: table_tlws_by_table.cc:222
static THR_LOCK m_table_lock
Table share lock.
Definition: table_tlws_by_table.h:110
static int delete_all_rows()
Definition: table_tlws_by_table.cc:170
PFS_simple_index m_pos
Current position.
Definition: table_tlws_by_table.h:117
static PFS_engine_table * create(PFS_engine_table_share *)
Definition: table_tlws_by_table.cc:166
void reset_position() override
Reset the cursor position to the beginning of the table.
Definition: table_tlws_by_table.cc:185
static Plugin_table m_table_def
Table definition.
Definition: table_tlws_by_table.h:112
static ha_rows get_row_count()
Definition: table_tlws_by_table.cc:176
~table_tlws_by_table() override=default
int rnd_next() override
Fetch the next row in this cursor.
Definition: table_tlws_by_table.cc:192
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:272
int make_row(PFS_table_share *table_share)
Definition: table_tlws_by_table.cc:251
static PFS_engine_table_share m_share
Table share.
Definition: table_tlws_by_table.h:83
This file includes constants used by all storage engines.
my_off_t ha_rows
Definition: my_base.h:1140
Definition: buf0block_hint.cc:30
Performance schema tables (declarations).
A PERFORMANCE_SCHEMA table share.
Definition: pfs_engine_table.h:359
Row fragment for columns OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_helper.h:602
Position of a cursor, for simple iterations.
Definition: pfs_engine_table.h:567
Row fragment for table lock statistics columns.
Definition: table_helper.h:799
Instrumentation metadata for a table share.
Definition: pfs_instr_class.h:409
Definition: table.h:1399
Definition: thr_lock.h:139
A row of table PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS_SUMMARY_BY_TABLE.
Definition: table_tlws_by_table.h:54
PFS_object_row m_object
Column OBJECT_TYPE, SCHEMA_NAME, OBJECT_NAME.
Definition: table_tlws_by_table.h:56
PFS_table_lock_stat_row m_stat
Columns COUNT/SUM/MIN/AVG/MAX READ/WRITE/READ_NORMAL/etc.
Definition: table_tlws_by_table.h:58
Helpers to implement a performance schema table.
unsigned int uint
Definition: uca9-dump.cc:75