21 #include "my_global.h"
22 #include "my_pthread.h"
30 THR_LOCK table_tiws_by_index_usage::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(
"INDEX_NAME") },
51 { C_STRING_WITH_LEN(
"varchar(64)") },
55 { C_STRING_WITH_LEN(
"COUNT_STAR") },
56 { C_STRING_WITH_LEN(
"bigint(20)") },
60 { C_STRING_WITH_LEN(
"SUM_TIMER_WAIT") },
61 { C_STRING_WITH_LEN(
"bigint(20)") },
65 { C_STRING_WITH_LEN(
"MIN_TIMER_WAIT") },
66 { C_STRING_WITH_LEN(
"bigint(20)") },
70 { C_STRING_WITH_LEN(
"AVG_TIMER_WAIT") },
71 { C_STRING_WITH_LEN(
"bigint(20)") },
75 { C_STRING_WITH_LEN(
"MAX_TIMER_WAIT") },
76 { C_STRING_WITH_LEN(
"bigint(20)") },
80 { C_STRING_WITH_LEN(
"COUNT_READ") },
81 { C_STRING_WITH_LEN(
"bigint(20)") },
85 { C_STRING_WITH_LEN(
"SUM_TIMER_READ") },
86 { C_STRING_WITH_LEN(
"bigint(20)") },
90 { C_STRING_WITH_LEN(
"MIN_TIMER_READ") },
91 { C_STRING_WITH_LEN(
"bigint(20)") },
95 { C_STRING_WITH_LEN(
"AVG_TIMER_READ") },
96 { C_STRING_WITH_LEN(
"bigint(20)") },
100 { C_STRING_WITH_LEN(
"MAX_TIMER_READ") },
101 { C_STRING_WITH_LEN(
"bigint(20)") },
105 { C_STRING_WITH_LEN(
"COUNT_WRITE") },
106 { C_STRING_WITH_LEN(
"bigint(20)") },
110 { C_STRING_WITH_LEN(
"SUM_TIMER_WRITE") },
111 { C_STRING_WITH_LEN(
"bigint(20)") },
115 { C_STRING_WITH_LEN(
"MIN_TIMER_WRITE") },
116 { C_STRING_WITH_LEN(
"bigint(20)") },
120 { C_STRING_WITH_LEN(
"AVG_TIMER_WRITE") },
121 { C_STRING_WITH_LEN(
"bigint(20)") },
125 { C_STRING_WITH_LEN(
"MAX_TIMER_WRITE") },
126 { C_STRING_WITH_LEN(
"bigint(20)") },
130 { C_STRING_WITH_LEN(
"COUNT_FETCH") },
131 { C_STRING_WITH_LEN(
"bigint(20)") },
135 { C_STRING_WITH_LEN(
"SUM_TIMER_FETCH") },
136 { C_STRING_WITH_LEN(
"bigint(20)") },
140 { C_STRING_WITH_LEN(
"MIN_TIMER_FETCH") },
141 { C_STRING_WITH_LEN(
"bigint(20)") },
145 { C_STRING_WITH_LEN(
"AVG_TIMER_FETCH") },
146 { C_STRING_WITH_LEN(
"bigint(20)") },
150 { C_STRING_WITH_LEN(
"MAX_TIMER_FETCH") },
151 { C_STRING_WITH_LEN(
"bigint(20)") },
155 { C_STRING_WITH_LEN(
"COUNT_INSERT") },
156 { C_STRING_WITH_LEN(
"bigint(20)") },
160 { C_STRING_WITH_LEN(
"SUM_TIMER_INSERT") },
161 { C_STRING_WITH_LEN(
"bigint(20)") },
165 { C_STRING_WITH_LEN(
"MIN_TIMER_INSERT") },
166 { C_STRING_WITH_LEN(
"bigint(20)") },
170 { C_STRING_WITH_LEN(
"AVG_TIMER_INSERT") },
171 { C_STRING_WITH_LEN(
"bigint(20)") },
175 { C_STRING_WITH_LEN(
"MAX_TIMER_INSERT") },
176 { C_STRING_WITH_LEN(
"bigint(20)") },
180 { C_STRING_WITH_LEN(
"COUNT_UPDATE") },
181 { C_STRING_WITH_LEN(
"bigint(20)") },
185 { C_STRING_WITH_LEN(
"SUM_TIMER_UPDATE") },
186 { C_STRING_WITH_LEN(
"bigint(20)") },
190 { C_STRING_WITH_LEN(
"MIN_TIMER_UPDATE") },
191 { C_STRING_WITH_LEN(
"bigint(20)") },
195 { C_STRING_WITH_LEN(
"AVG_TIMER_UPDATE") },
196 { C_STRING_WITH_LEN(
"bigint(20)") },
200 { C_STRING_WITH_LEN(
"MAX_TIMER_UPDATE") },
201 { C_STRING_WITH_LEN(
"bigint(20)") },
205 { C_STRING_WITH_LEN(
"COUNT_DELETE") },
206 { C_STRING_WITH_LEN(
"bigint(20)") },
210 { C_STRING_WITH_LEN(
"SUM_TIMER_DELETE") },
211 { C_STRING_WITH_LEN(
"bigint(20)") },
215 { C_STRING_WITH_LEN(
"MIN_TIMER_DELETE") },
216 { C_STRING_WITH_LEN(
"bigint(20)") },
220 { C_STRING_WITH_LEN(
"AVG_TIMER_DELETE") },
221 { C_STRING_WITH_LEN(
"bigint(20)") },
225 { C_STRING_WITH_LEN(
"MAX_TIMER_DELETE") },
226 { C_STRING_WITH_LEN(
"bigint(20)") },
232 table_tiws_by_index_usage::m_field_def=
238 { C_STRING_WITH_LEN(
"table_io_waits_summary_by_index_usage") },
240 table_tiws_by_index_usage::create,
242 table_tiws_by_index_usage::delete_all_rows,
252 table_tiws_by_index_usage::create(
void)
258 table_tiws_by_index_usage::delete_all_rows(
void)
260 reset_table_io_waits_by_table_handle();
261 reset_table_io_waits_by_table();
265 table_tiws_by_index_usage::table_tiws_by_index_usage()
267 m_row_exists(false), m_pos(), m_next_pos()
286 for (m_pos.
set_at(&m_next_pos);
287 m_pos.has_more_table();
293 uint safe_key_count= sanitize_index_count(table_share->
m_key_count);
310 return HA_ERR_END_OF_FILE;
323 uint safe_key_count= sanitize_index_count(table_share->
m_key_count);
336 return HA_ERR_RECORD_DELETED;
367 if (unlikely(! m_row_exists))
368 return HA_ERR_RECORD_DELETED;
371 DBUG_ASSERT(table->s->null_bytes == 1);
374 for (; (f= *fields) ; fields++)
376 if (read_all || bitmap_is_set(table->read_set, f->field_index))
378 switch(f->field_index)