| 1 |
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES'; |
| 2 |
UPDATE performance_schema.setup_instruments SET enabled = 'YES' |
| 3 |
WHERE name LIKE 'wait/synch/mutex/%' |
| 4 |
OR name LIKE 'wait/synch/rwlock/%'; |
| 5 |
truncate table performance_schema.events_statements_summary_by_digest; |
| 6 |
flush global status; |
| 7 |
select NAME from performance_schema.mutex_instances |
| 8 |
where NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex' GROUP BY NAME; |
| 9 |
NAME |
| 10 |
wait/synch/mutex/mysys/THR_LOCK::mutex |
| 11 |
select NAME from performance_schema.rwlock_instances |
| 12 |
where NAME = 'wait/synch/rwlock/sql/LOCK_grant' limit 1; |
| 13 |
NAME |
| 14 |
wait/synch/rwlock/sql/LOCK_grant |
| 15 |
DROP TABLE IF EXISTS t1; |
| 16 |
CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') |
| 17 |
ENGINE=MyISAM; |
| 18 |
INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); |
| 19 |
TRUNCATE TABLE performance_schema.events_waits_history_long; |
| 20 |
TRUNCATE TABLE performance_schema.events_waits_history; |
| 21 |
TRUNCATE TABLE performance_schema.events_waits_current; |
| 22 |
SELECT * FROM t1 WHERE id = 1; |
| 23 |
id b |
| 24 |
1 initial value |
| 25 |
SET @before_count = (SELECT SUM(TIMER_WAIT) |
| 26 |
FROM performance_schema.events_waits_history_long |
| 27 |
WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex')); |
| 28 |
SELECT * FROM t1; |
| 29 |
id b |
| 30 |
1 initial value |
| 31 |
2 initial value |
| 32 |
3 initial value |
| 33 |
4 initial value |
| 34 |
5 initial value |
| 35 |
6 initial value |
| 36 |
7 initial value |
| 37 |
8 initial value |
| 38 |
SET @after_count = (SELECT SUM(TIMER_WAIT) |
| 39 |
FROM performance_schema.events_waits_history_long |
| 40 |
WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex')); |
| 41 |
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed; |
| 42 |
test_fm1_timed |
| 43 |
Success |
| 44 |
UPDATE performance_schema.setup_instruments SET enabled = 'NO' |
| 45 |
WHERE NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex'; |
| 46 |
TRUNCATE TABLE performance_schema.events_waits_history_long; |
| 47 |
TRUNCATE TABLE performance_schema.events_waits_history; |
| 48 |
TRUNCATE TABLE performance_schema.events_waits_current; |
| 49 |
SELECT * FROM t1 WHERE id = 1; |
| 50 |
id b |
| 51 |
1 initial value |
| 52 |
SET @before_count = (SELECT SUM(TIMER_WAIT) |
| 53 |
FROM performance_schema.events_waits_history_long |
| 54 |
WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex')); |
| 55 |
SELECT * FROM t1; |
| 56 |
id b |
| 57 |
1 initial value |
| 58 |
2 initial value |
| 59 |
3 initial value |
| 60 |
4 initial value |
| 61 |
5 initial value |
| 62 |
6 initial value |
| 63 |
7 initial value |
| 64 |
8 initial value |
| 65 |
SET @after_count = (SELECT SUM(TIMER_WAIT) |
| 66 |
FROM performance_schema.events_waits_history_long |
| 67 |
WHERE (EVENT_NAME = 'wait/synch/mutex/mysys/THR_LOCK::mutex')); |
| 68 |
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed; |
| 69 |
test_fm2_timed |
| 70 |
Success |
| 71 |
TRUNCATE TABLE performance_schema.events_waits_history_long; |
| 72 |
TRUNCATE TABLE performance_schema.events_waits_history; |
| 73 |
TRUNCATE TABLE performance_schema.events_waits_current; |
| 74 |
show variables like "%not_found%"; |
| 75 |
Variable_name Value |
| 76 |
SET @before_count = (SELECT SUM(TIMER_WAIT) |
| 77 |
FROM performance_schema.events_waits_history_long |
| 78 |
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); |
| 79 |
show variables like "%not_found%"; |
| 80 |
Variable_name Value |
| 81 |
SET @after_count = (SELECT SUM(TIMER_WAIT) |
| 82 |
FROM performance_schema.events_waits_history_long |
| 83 |
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); |
| 84 |
SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed; |
| 85 |
test_fm1_rw_timed |
| 86 |
Success |
| 87 |
UPDATE performance_schema.setup_instruments SET enabled = 'NO' |
| 88 |
WHERE NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash'; |
| 89 |
TRUNCATE TABLE performance_schema.events_waits_history_long; |
| 90 |
TRUNCATE TABLE performance_schema.events_waits_history; |
| 91 |
TRUNCATE TABLE performance_schema.events_waits_current; |
| 92 |
show variables like "%not_found%"; |
| 93 |
Variable_name Value |
| 94 |
SET @before_count = (SELECT SUM(TIMER_WAIT) |
| 95 |
FROM performance_schema.events_waits_history_long |
| 96 |
WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_system_variables_hash')); |
| 97 |
show variables like "%not_found%"; |
| 98 |
Variable_name Value |
| 99 |
SET @after_count = (SELECT SUM(TIMER_WAIT) |
| 100 |
FROM performance_schema.events_waits_history_long |
| 101 |
WHERE (EVENT_NAME = 'LOCK_system_variables_hash')); |
| 102 |
SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; |
| 103 |
test_fm2_rw_timed |
| 104 |
Success |
| 105 |
UPDATE performance_schema.setup_instruments SET enabled = 'YES'; |
| 106 |
DROP TABLE t1; |
| 107 |
UPDATE performance_schema.setup_instruments SET enabled = 'YES', timed = 'YES'; |
| 108 |
show global status like "performance_schema%"; |
| 109 |
Variable_name Value |
| 110 |
Performance_schema_accounts_lost 0 |
| 111 |
Performance_schema_cond_classes_lost 0 |
| 112 |
Performance_schema_cond_instances_lost 0 |
| 113 |
Performance_schema_digest_lost 0 |
| 114 |
Performance_schema_file_classes_lost 0 |
| 115 |
Performance_schema_file_handles_lost 0 |
| 116 |
Performance_schema_file_instances_lost 0 |
| 117 |
Performance_schema_hosts_lost 0 |
| 118 |
Performance_schema_index_stat_lost 0 |
| 119 |
Performance_schema_locker_lost 0 |
| 120 |
Performance_schema_memory_classes_lost 0 |
| 121 |
Performance_schema_metadata_lock_lost 0 |
| 122 |
Performance_schema_mutex_classes_lost 0 |
| 123 |
Performance_schema_mutex_instances_lost 0 |
| 124 |
Performance_schema_nested_statement_lost 0 |
| 125 |
Performance_schema_prepared_statements_lost 0 |
| 126 |
Performance_schema_program_lost 0 |
| 127 |
Performance_schema_rwlock_classes_lost 0 |
| 128 |
Performance_schema_rwlock_instances_lost 0 |
| 129 |
Performance_schema_session_connect_attrs_lost 0 |
| 130 |
Performance_schema_socket_classes_lost 0 |
| 131 |
Performance_schema_socket_instances_lost 0 |
| 132 |
Performance_schema_stage_classes_lost 0 |
| 133 |
Performance_schema_statement_classes_lost 0 |
| 134 |
Performance_schema_table_handles_lost 0 |
| 135 |
Performance_schema_table_instances_lost 0 |
| 136 |
Performance_schema_table_lock_stat_lost 0 |
| 137 |
Performance_schema_thread_classes_lost 0 |
| 138 |
Performance_schema_thread_instances_lost 0 |
| 139 |
Performance_schema_users_lost 0 |