21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_tlws_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_READ_NORMAL") },
126 { C_STRING_WITH_LEN(
"bigint(20)") },
130 { C_STRING_WITH_LEN(
"SUM_TIMER_READ_NORMAL") },
131 { C_STRING_WITH_LEN(
"bigint(20)") },
135 { C_STRING_WITH_LEN(
"MIN_TIMER_READ_NORMAL") },
136 { C_STRING_WITH_LEN(
"bigint(20)") },
140 { C_STRING_WITH_LEN(
"AVG_TIMER_READ_NORMAL") },
141 { C_STRING_WITH_LEN(
"bigint(20)") },
145 { C_STRING_WITH_LEN(
"MAX_TIMER_READ_NORMAL") },
146 { C_STRING_WITH_LEN(
"bigint(20)") },
150 { C_STRING_WITH_LEN(
"COUNT_READ_WITH_SHARED_LOCKS") },
151 { C_STRING_WITH_LEN(
"bigint(20)") },
155 { C_STRING_WITH_LEN(
"SUM_TIMER_READ_WITH_SHARED_LOCKS") },
156 { C_STRING_WITH_LEN(
"bigint(20)") },
160 { C_STRING_WITH_LEN(
"MIN_TIMER_READ_WITH_SHARED_LOCKS") },
161 { C_STRING_WITH_LEN(
"bigint(20)") },
165 { C_STRING_WITH_LEN(
"AVG_TIMER_READ_WITH_SHARED_LOCKS") },
166 { C_STRING_WITH_LEN(
"bigint(20)") },
170 { C_STRING_WITH_LEN(
"MAX_TIMER_READ_WITH_SHARED_LOCKS") },
171 { C_STRING_WITH_LEN(
"bigint(20)") },
175 { C_STRING_WITH_LEN(
"COUNT_READ_HIGH_PRIORITY") },
176 { C_STRING_WITH_LEN(
"bigint(20)") },
180 { C_STRING_WITH_LEN(
"SUM_TIMER_READ_HIGH_PRIORITY") },
181 { C_STRING_WITH_LEN(
"bigint(20)") },
185 { C_STRING_WITH_LEN(
"MIN_TIMER_READ_HIGH_PRIORITY") },
186 { C_STRING_WITH_LEN(
"bigint(20)") },
190 { C_STRING_WITH_LEN(
"AVG_TIMER_READ_HIGH_PRIORITY") },
191 { C_STRING_WITH_LEN(
"bigint(20)") },
195 { C_STRING_WITH_LEN(
"MAX_TIMER_READ_HIGH_PRIORITY") },
196 { C_STRING_WITH_LEN(
"bigint(20)") },
200 { C_STRING_WITH_LEN(
"COUNT_READ_NO_INSERT") },
201 { C_STRING_WITH_LEN(
"bigint(20)") },
205 { C_STRING_WITH_LEN(
"SUM_TIMER_READ_NO_INSERT") },
206 { C_STRING_WITH_LEN(
"bigint(20)") },
210 { C_STRING_WITH_LEN(
"MIN_TIMER_READ_NO_INSERT") },
211 { C_STRING_WITH_LEN(
"bigint(20)") },
215 { C_STRING_WITH_LEN(
"AVG_TIMER_READ_NO_INSERT") },
216 { C_STRING_WITH_LEN(
"bigint(20)") },
220 { C_STRING_WITH_LEN(
"MAX_TIMER_READ_NO_INSERT") },
221 { C_STRING_WITH_LEN(
"bigint(20)") },
225 { C_STRING_WITH_LEN(
"COUNT_READ_EXTERNAL") },
226 { C_STRING_WITH_LEN(
"bigint(20)") },
230 { C_STRING_WITH_LEN(
"SUM_TIMER_READ_EXTERNAL") },
231 { C_STRING_WITH_LEN(
"bigint(20)") },
235 { C_STRING_WITH_LEN(
"MIN_TIMER_READ_EXTERNAL") },
236 { C_STRING_WITH_LEN(
"bigint(20)") },
240 { C_STRING_WITH_LEN(
"AVG_TIMER_READ_EXTERNAL") },
241 { C_STRING_WITH_LEN(
"bigint(20)") },
245 { C_STRING_WITH_LEN(
"MAX_TIMER_READ_EXTERNAL") },
246 { C_STRING_WITH_LEN(
"bigint(20)") },
250 { C_STRING_WITH_LEN(
"COUNT_WRITE_ALLOW_WRITE") },
251 { C_STRING_WITH_LEN(
"bigint(20)") },
255 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_ALLOW_WRITE") },
256 { C_STRING_WITH_LEN(
"bigint(20)") },
260 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_ALLOW_WRITE") },
261 { C_STRING_WITH_LEN(
"bigint(20)") },
265 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_ALLOW_WRITE") },
266 { C_STRING_WITH_LEN(
"bigint(20)") },
270 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_ALLOW_WRITE") },
271 { C_STRING_WITH_LEN(
"bigint(20)") },
275 { C_STRING_WITH_LEN(
"COUNT_WRITE_CONCURRENT_INSERT") },
276 { C_STRING_WITH_LEN(
"bigint(20)") },
280 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_CONCURRENT_INSERT") },
281 { C_STRING_WITH_LEN(
"bigint(20)") },
285 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_CONCURRENT_INSERT") },
286 { C_STRING_WITH_LEN(
"bigint(20)") },
290 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_CONCURRENT_INSERT") },
291 { C_STRING_WITH_LEN(
"bigint(20)") },
295 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_CONCURRENT_INSERT") },
296 { C_STRING_WITH_LEN(
"bigint(20)") },
300 { C_STRING_WITH_LEN(
"COUNT_WRITE_DELAYED") },
301 { C_STRING_WITH_LEN(
"bigint(20)") },
305 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_DELAYED") },
306 { C_STRING_WITH_LEN(
"bigint(20)") },
310 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_DELAYED") },
311 { C_STRING_WITH_LEN(
"bigint(20)") },
315 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_DELAYED") },
316 { C_STRING_WITH_LEN(
"bigint(20)") },
320 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_DELAYED") },
321 { C_STRING_WITH_LEN(
"bigint(20)") },
325 { C_STRING_WITH_LEN(
"COUNT_WRITE_LOW_PRIORITY") },
326 { C_STRING_WITH_LEN(
"bigint(20)") },
330 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_LOW_PRIORITY") },
331 { C_STRING_WITH_LEN(
"bigint(20)") },
335 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_LOW_PRIORITY") },
336 { C_STRING_WITH_LEN(
"bigint(20)") },
340 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_LOW_PRIORITY") },
341 { C_STRING_WITH_LEN(
"bigint(20)") },
345 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_LOW_PRIORITY") },
346 { C_STRING_WITH_LEN(
"bigint(20)") },
350 { C_STRING_WITH_LEN(
"COUNT_WRITE_NORMAL") },
351 { C_STRING_WITH_LEN(
"bigint(20)") },
355 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_NORMAL") },
356 { C_STRING_WITH_LEN(
"bigint(20)") },
360 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_NORMAL") },
361 { C_STRING_WITH_LEN(
"bigint(20)") },
365 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_NORMAL") },
366 { C_STRING_WITH_LEN(
"bigint(20)") },
370 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_NORMAL") },
371 { C_STRING_WITH_LEN(
"bigint(20)") },
375 { C_STRING_WITH_LEN(
"COUNT_WRITE_EXTERNAL") },
376 { C_STRING_WITH_LEN(
"bigint(20)") },
380 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE_EXTERNAL") },
381 { C_STRING_WITH_LEN(
"bigint(20)") },
385 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE_EXTERNAL") },
386 { C_STRING_WITH_LEN(
"bigint(20)") },
390 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE_EXTERNAL") },
391 { C_STRING_WITH_LEN(
"bigint(20)") },
395 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE_EXTERNAL") },
396 { C_STRING_WITH_LEN(
"bigint(20)") },
402 table_tlws_by_table::m_field_def=
408 { C_STRING_WITH_LEN(
"table_lock_waits_summary_by_table") },
410 table_tlws_by_table::create,
412 table_tlws_by_table::delete_all_rows,
422 table_tlws_by_table::create(
void)
428 table_tlws_by_table::delete_all_rows(
void)
430 reset_table_lock_waits_by_table_handle();
431 reset_table_lock_waits_by_table();
435 table_tlws_by_table::table_tlws_by_table()
437 m_row_exists(false), m_pos(0), m_next_pos(0)
456 for (m_pos.
set_at(&m_next_pos);
463 make_row(table_share);
469 return HA_ERR_END_OF_FILE;
482 make_row(table_share);
486 return HA_ERR_RECORD_DELETED;
517 if (unlikely(! m_row_exists))
518 return HA_ERR_RECORD_DELETED;
521 DBUG_ASSERT(table->s->null_bytes == 1);
524 for (; (f= *fields) ; fields++)
526 if (read_all || bitmap_is_set(table->read_set, f->field_index))
528 switch(f->field_index)