21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_tiws_by_table::m_table_lock;
35 { C_STRING_WITH_LEN(
"OBJECT_TYPE") },
36 { C_STRING_WITH_LEN(
"varchar(64)") },
40 { C_STRING_WITH_LEN(
"OBJECT_SCHEMA") },
41 { C_STRING_WITH_LEN(
"varchar(64)") },
45 { C_STRING_WITH_LEN(
"OBJECT_NAME") },
46 { C_STRING_WITH_LEN(
"varchar(64)") },
50 { C_STRING_WITH_LEN(
"COUNT_STAR") },
51 { C_STRING_WITH_LEN(
"bigint(20)") },
55 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
56 { C_STRING_WITH_LEN(
"bigint(20)") },
60 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
61 { C_STRING_WITH_LEN(
"bigint(20)") },
65 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
66 { C_STRING_WITH_LEN(
"bigint(20)") },
70 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
71 { C_STRING_WITH_LEN(
"bigint(20)") },
75 { C_STRING_WITH_LEN(
"COUNT_READ") },
76 { C_STRING_WITH_LEN(
"bigint(20)") },
80 { C_STRING_WITH_LEN(
"SUM_TIMER_READ") },
81 { C_STRING_WITH_LEN(
"bigint(20)") },
85 { C_STRING_WITH_LEN(
"MIN_TIMER_READ") },
86 { C_STRING_WITH_LEN(
"bigint(20)") },
90 { C_STRING_WITH_LEN(
"AVG_TIMER_READ") },
91 { C_STRING_WITH_LEN(
"bigint(20)") },
95 { C_STRING_WITH_LEN(
"MAX_TIMER_READ") },
96 { C_STRING_WITH_LEN(
"bigint(20)") },
100 { C_STRING_WITH_LEN(
"COUNT_WRITE") },
101 { C_STRING_WITH_LEN(
"bigint(20)") },
105 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE") },
106 { C_STRING_WITH_LEN(
"bigint(20)") },
110 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE") },
111 { C_STRING_WITH_LEN(
"bigint(20)") },
115 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE") },
116 { C_STRING_WITH_LEN(
"bigint(20)") },
120 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE") },
121 { C_STRING_WITH_LEN(
"bigint(20)") },
125 { C_STRING_WITH_LEN(
"COUNT_FETCH") },
126 { C_STRING_WITH_LEN(
"bigint(20)") },
130 { C_STRING_WITH_LEN(
"SUM_TIMER_FETCH") },
131 { C_STRING_WITH_LEN(
"bigint(20)") },
135 { C_STRING_WITH_LEN(
"MIN_TIMER_FETCH") },
136 { C_STRING_WITH_LEN(
"bigint(20)") },
140 { C_STRING_WITH_LEN(
"AVG_TIMER_FETCH") },
141 { C_STRING_WITH_LEN(
"bigint(20)") },
145 { C_STRING_WITH_LEN(
"MAX_TIMER_FETCH") },
146 { C_STRING_WITH_LEN(
"bigint(20)") },
150 { C_STRING_WITH_LEN(
"COUNT_INSERT") },
151 { C_STRING_WITH_LEN(
"bigint(20)") },
155 { C_STRING_WITH_LEN(
"SUM_TIMER_INSERT") },
156 { C_STRING_WITH_LEN(
"bigint(20)") },
160 { C_STRING_WITH_LEN(
"MIN_TIMER_INSERT") },
161 { C_STRING_WITH_LEN(
"bigint(20)") },
165 { C_STRING_WITH_LEN(
"AVG_TIMER_INSERT") },
166 { C_STRING_WITH_LEN(
"bigint(20)") },
170 { C_STRING_WITH_LEN(
"MAX_TIMER_INSERT") },
171 { C_STRING_WITH_LEN(
"bigint(20)") },
175 { C_STRING_WITH_LEN(
"COUNT_UPDATE") },
176 { C_STRING_WITH_LEN(
"bigint(20)") },
180 { C_STRING_WITH_LEN(
"SUM_TIMER_UPDATE") },
181 { C_STRING_WITH_LEN(
"bigint(20)") },
185 { C_STRING_WITH_LEN(
"MIN_TIMER_UPDATE") },
186 { C_STRING_WITH_LEN(
"bigint(20)") },
190 { C_STRING_WITH_LEN(
"AVG_TIMER_UPDATE") },
191 { C_STRING_WITH_LEN(
"bigint(20)") },
195 { C_STRING_WITH_LEN(
"MAX_TIMER_UPDATE") },
196 { C_STRING_WITH_LEN(
"bigint(20)") },
200 { C_STRING_WITH_LEN(
"COUNT_DELETE") },
201 { C_STRING_WITH_LEN(
"bigint(20)") },
205 { C_STRING_WITH_LEN(
"SUM_TIMER_DELETE") },
206 { C_STRING_WITH_LEN(
"bigint(20)") },
210 { C_STRING_WITH_LEN(
"MIN_TIMER_DELETE") },
211 { C_STRING_WITH_LEN(
"bigint(20)") },
215 { C_STRING_WITH_LEN(
"AVG_TIMER_DELETE") },
216 { C_STRING_WITH_LEN(
"bigint(20)") },
220 { C_STRING_WITH_LEN(
"MAX_TIMER_DELETE") },
221 { C_STRING_WITH_LEN(
"bigint(20)") },
227 table_tiws_by_table::m_field_def=
233 { C_STRING_WITH_LEN(
"table_io_waits_summary_by_table") },
235 table_tiws_by_table::create,
237 table_tiws_by_table::delete_all_rows,
247 table_tiws_by_table::create(
void)
253 table_tiws_by_table::delete_all_rows(
void)
255 reset_table_io_waits_by_table_handle();
256 reset_table_io_waits_by_table();
260 table_tiws_by_table::table_tiws_by_table()
262 m_row_exists(false), m_pos(0), m_next_pos(0)
281 for (m_pos.
set_at(&m_next_pos);
288 make_row(table_share);
294 return HA_ERR_END_OF_FILE;
307 make_row(table_share);
311 return HA_ERR_RECORD_DELETED;
342 if (unlikely(! m_row_exists))
343 return HA_ERR_RECORD_DELETED;
346 DBUG_ASSERT(table->s->null_bytes == 1);
349 for (; (f= *fields) ; fields++)
351 if (read_all || bitmap_is_set(table->read_set, f->field_index))
353 switch(f->field_index)