PERFORMANCE_SCHEMA
INFORMATION_SCHEMA
PERFORMANCE_SCHEMA
performance_schema
SELECT
performance_schema
EXPLAIN
sys
performance_schema
[mysqld] performance_schema=ON
performance_schema
MySQL的> SHOW VARIABLES LIKE 'performance_schema';
-------------------- ------- | variable_name |价值| -------------------- ------- | performance_schema |在| -------------------- -------
ON
INFORMATION_SCHEMA.ENGINES
SHOW ENGINES
MySQL的> SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE ENGINE='PERFORMANCE_SCHEMA'\G
*************************** 1。行***************************引擎:performance_schema支持:是的评论:性能schematransactions:没有阿隆索:没有保存点:nomysql > SHOW ENGINES\G
…发动机:performance_schema支持:是的评论:性能schematransactions:没有阿隆索:没有保存点:NO.。
PERFORMANCE_SCHEMA
performance_schema
MySQL的> USE performance_schema;
performance_schema
performance_schema
SHOW
MySQL的> SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'performance_schema';
------------------------------------------------------ | table_name | ------------------------------------------------------ |账户| | cond_instances |…| events_stages_current | | events_stages_history | | events_stages_history_long | | events_stages_summary_by_account_by_event_name | | events_stages_summary_by_host_by_event_name | | events_stages_summary_by_thread_by_event_name | | events_stages_summary_by_user_by_event_name | | events_stages_summary_global_by_event_name | | events_statements_current | | events_statements_history | | events_statements_history_long |…| file_instances | | file_summary_by_event_name | | file_summary_by_instance | | host_cache | |主机| | memory_summary_by_account_by_event_name | | memory_summary_by_host_by_event_name | | memory_summary_by_thread_by_event_name | | memory_summary_by_user_by_event_name | | memory_summary_global_by_event_name | | metadata_locks | | mutex_instances | | objects_summary_global_by_type | | performance_timers | | replication_connection_configuration | | replication_connection_status | | replication_applier_configuration | | replication_applier_status | | replication_applier_status_by_coordinator | | replication_applier_status_by_worker | | rwlock_instances| | session_account_connect_attrs | | session_connect_attrs | | setup_actors | | setup_consumers | | setup_instruments | | setup_objects | | socket_instances | | socket_summary_by_event_name | | socket_summary_by_instance | | table_handles | | table_io_waits_summary_by_index_usage | | table_io_waits_summary_by_table | | table_lock_waits_summary_by_table | |线程| |用户| ------------------------------------------------------ MySQL > SHOW TABLES FROM performance_schema;
------------------------------------------------------ | tables_in_performance_schema | ------------------------------------------------------ |账户| | cond_instances | | events_stages_current | | events_stages_history | | events_stages_history_long |…
performance_schema
SHOW CREATE TABLE
MySQL的> SHOW CREATE TABLE setup_consumers\G
*************************** 1. row *************************** Table: setup_consumersCreate Table: CREATE TABLE `setup_consumers` ( `NAME` varchar(64) NOT NULL, `ENABLED` enum('YES','NO') NOT NULL, PRIMARY KEY (`NAME`)) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8
INFORMATION_SCHEMA.COLUMNS
SHOW
COLUMNS
performance_schema
mysql>UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES';
Query OK, 560 rows affected (0.04 sec) mysql>UPDATE setup_consumers SET ENABLED = 'YES';
Query OK, 10 rows affected (0.00 sec)
events_waits_current
MySQL的> SELECT * FROM events_waits_current\G
*************************** 1。行*************************** thread_id:0:5523:5523 event_id end_event_id event_name:等待/同步/互斥/ mysys / thr_lock::互斥来源:thr_lock。C:525 timer_start:201660494489586:201660494576112:86526 timer_end timer_wait旋转:空object_schema:空object_name:空index_name:空object_type:nullobject_instance_begin:142270668 nesting_event_id:空nesting_event_type:空操作:锁number_of_bytes:空标志:0…
THR_LOCK::mutex
EVENT_NAME
TIMER_END
NULL
events_waits_history
events_waits_history_long
MySQL的> SELECT EVENT_ID, EVENT_NAME, TIMER_WAIT
FROM events_waits_history WHERE THREAD_ID = 13
ORDER BY EVENT_ID;
---------- ----------------------------------------- ------------ | EVENT_ID | EVENT_NAME | TIMER_WAIT | ---------- ----------------------------------------- ------------ | 86 | wait/synch/mutex/mysys/THR_LOCK::mutex | 686322 || 87 | wait/synch/mutex/mysys/THR_LOCK_malloc | 320535 || 88 | wait/synch/mutex/mysys/THR_LOCK_malloc | 339390 || 89 | wait/synch/mutex/mysys/THR_LOCK_malloc | 377100 || 90 | wait/synch/mutex/sql/LOCK_plugin | 614673 || 91 | wait/synch/mutex/sql/LOCK_open | 659925 || 92 | wait/synch/mutex/sql/THD::LOCK_thd_data | 494001 || 93 | wait/synch/mutex/mysys/THR_LOCK_malloc | 222489 || 94 | wait/synch/mutex/mysys/THR_LOCK_malloc | 214947 || 95 | wait/synch/mutex/mysys/LOCK_alarm | 312993 | ---------- ----------------------------------------- ------------
events_waits_summary_global_by_event_name
SUM_TIMER_WAIT
SUM(TIMER_WAIT)
MySQL的> SELECT EVENT_NAME, COUNT_STAR
FROM events_waits_summary_global_by_event_name
ORDER BY COUNT_STAR DESC LIMIT 10;
--------------------------------------------------- ------------ |事件_ name count _ | --------------------------------------------------- ------------ |等明星| /同步/互斥锁_ /苏氨酸/ mysys _ malloc等| 6419 | | / IO /文件/ | FRM | 452 | SQL /等/同步/互斥锁的SQL /插件/ _ | 337 |等| /同步/互斥mysys /锁/苏氨酸_ _开放| 187 | | /同步/互斥等mysys /锁/报警等_ | 147 | | /同步/互斥锁的SQL /:/ _ THD _ THD |等数据| 115 | MyISAM文件/ / / / IO kfile | 102 | /同步/ |等互斥锁_ / SQL /综合系统变量_ _ | 89 | | /同步/互斥等mysys /苏氨酸/ _互斥锁:| 89 | | /同步/互斥等_开/锁/ SQL MySQL --------------------------------------------------- ------------ | 88 | > SELECT EVENT_NAME, SUM_TIMER_WAIT
FROM events_waits_summary_global_by_event_name
ORDER BY SUM_TIMER_WAIT DESC LIMIT 10;
它的名字| _ ---------------------------------------- |事件和定时器等_ _ | ---------------------------------------- ---------------- |等待IO / / / / MySQL的SQL日志文件_ | 1599816582 | |同步/互斥等待/ / / mysys THR _锁_ malloc | 1530083250 | | wait / IO /文件/ SQL / binlog _指数| 1385291934 | | wait SQL文件IO / / / / / 1292823243 FRM | | |等待IO /文件/ / kfile MyISAM | 411193611 | |等待IO /文件/ / / dfile MyISAM | 322401645 | |同步/互斥等待/ / / mysys报警锁_ | 145126935 | |等待IO / / / / casetest | 104324715 SQL文件| | /同步/互斥等待SQL /锁/ _插件| 86027823 | | wait / IO /文件/ SQL / PID | 72591750 | ---------------------------------------- ----------------
THR_LOCK_malloc
THR_LOCK_malloc
file_instances
MySQL的> SELECT * FROM file_instances\G
*************************** 1。行*************************** file_name:/选择/ MySQL日志/ 60500 / binlog.000007event_name:等待/ IO /文件/数据库/ binlogopen_count:0 *************************** 2。行*************************** file_name:/选择/ MySQL / 60500 /数据/ MySQL / tables_priv.myievent_name:等待/ IO /文件/表/ kfileopen_count:1 *************************** 3。行*************************** file_name:/选择/ MySQL / 60500 /数据/ MySQL / columns_priv.myievent_name:等待/ IO /文件/表/ kfileopen_count:1…
setup_instruments
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments;
--------------------------------------------------- --------- ------- |名字|启用|定时| --------------------------------------------------- --------- -------…|阶段/ SQL /结束|没有|没有| |阶段/ SQL执行|没有|没有| |阶段/ SQL /初始化|没有|没有| |阶段/ SQL /插入|没有|没有|…|声明/ SQL /负载|是|是| |声明/ SQL /格兰特|是|是| |声明/ SQL /检查|是|是| |声明/ SQL /冲洗|是|是|…|等待/同步/互斥/ SQL / lock_global_read_lock |是|是|等待/同步/互斥| / SQL / lock_global_system_variables |是|是|等待/同步/互斥| / SQL / lock_lock_db |是|是| |等待/同步/互斥/平方信用证是lock_manager | |是|…|等待/同步/ rwlock / SQL / lock_grant |是|是| |等待/同步/ rwlock / SQL /记录器::lock_logger |是|是| |等待/同步/ rwlock / SQL / lock_sys_init_connect |是|是| |等待/同步/ rwlock / SQL / lock_sys_init_slave |是|是|…|等待/ IO /文件/数据库/ binlog |是|是| |等待/ IO /文件/数据库/ binlog_index |是|是| |等待/ IO /文件/数据库/用例|是|是| |等待/ IO /文件/数据库/ dbopt |是|是|…
ENABLED
NO
MySQL的> UPDATE setup_instruments SET ENABLED = 'NO'
WHERE NAME = 'wait/synch/mutex/sql/LOCK_mysql_create_db';
performance_schema
setup_consumers
MySQL的> SELECT * FROM setup_consumers;
---------------------------------- --------- |名字|启用| ---------------------------------- --------- | events_stages_current |没有| | events_stages_history |没有| | events_stages_history_long |没有| | events_statements_current |是| | events_statements_history |是| | events_statements_history_long |没有| | events_transactions_current |是| | events_transactions_history |是| | events_transactions_history_long |没有| | events_waits_current |没有| | events_waits_history |没有| | events_waits_history_long |没有| | global_instrumentation |是| | thread_instrumentation |是| | statements_digest |是| ---------------------------------- ---------
ENABLED
performance_timers
shell>cmake . \
-DDISABLE_PSI_STAGE=1 \
-DDISABLE_PSI_STATEMENT=1
DISABLE_PSI_
XXX
performance_schema
[错误]本地表performance_schema’。'events_waits_history'has错结构[错误]本地表performance_schema”'events_waits_history_long'has错结构…
PERFORMANCE_SCHEMA
SHOW ENGINES
performance_schema
[mysqld] performance_schema=ON
performance_schema
--performance-schema-instrument='instrument_name
=value
'
instrument_name
value
OFF
0
ON
1
COUNTED
--performance-schema-instrument
--performance-schema-instrument='wait/synch/cond/%=COUNTED'
--performance-schema-instrument='%=OFF'
memory/performance_schema/%
--performance-schema-consumer-consumer_name
=value
consumer_name
value
OFF
0
ON
1
events_waits_history
--performance-schema-consumer-events-waits-history=ON
setup_consumers
setup_consumers
mysql> SHOW VARIABLES LIKE 'perf%';
+--------------------------------------------------------+---------+
| Variable_name | Value |
+--------------------------------------------------------+---------+
| performance_schema | ON |
| performance_schema_accounts_size | 100 |
| performance_schema_digests_size | 200 |
| performance_schema_events_stages_history_long_size | 10000 |
| performance_schema_events_stages_history_size | 10 |
| performance_schema_events_statements_history_long_size | 10000 |
| performance_schema_events_statements_history_size | 10 |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| performance_schema_hosts_size | 100 |
| performance_schema_max_cond_classes | 80 |
| performance_schema_max_cond_instances | 1000 |
...
performance_schema
OFF
my.cnf
[mysqld]performance_schemaperformance_schema_events_waits_history_size=20performance_schema_events_waits_history_long_size=15000
max_connections open_files_limit table_definition_cache table_open_cache
SHOW VARIABLES
SHOW VARIABLES
mysql>SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'performance_schema'
AND TABLE_NAME LIKE 'setup%';
+-------------------+ | TABLE_NAME | +-------------------+ | setup_actors | | setup_consumers | | setup_instruments | | setup_objects | | setup_threads | +-------------------+
UPDATE
setup_instruments
setup_consumers
--init-file=
file_name
--init-file
performance_timers
MySQL的> SELECT * FROM performance_timers;
------------- ----------------- ------------------ ---------------- | timer_name | timer_frequency | timer_resolution | timer_overhead | ------------- ----------------- ------------------ ---------------- |周期| 2389029850 | 1 | 72 | |纳秒| 1000000000 | 1 | 112 | |微秒| 1000000 | 1 | 136 | |毫秒| 1036 | 1 | 168 | ------------- ----------------- ------------------ ----------------
NULL
TIMER_NAME
TIMER_FREQUENCY
TIMER_RESOLUTION
TIMER_OVERHEAD
CYCLE
NANOSECOND
MICROSECOND
CYCLE
NANOSECOND
CYCLE
gettimeofday()
RDTSC
TIMER_START
TIMER_WAIT
setup_instruments
TIMED
TIMER_START
TIMER_WAIT
TIMER_START
TIMER_WAIT
CYCLE
TIMER_START
ORDER
BY
TIMER_FREQUENCY
events_waits_current events_stages_current events_statements_current events_transactions_current
TIMER_START
TIMER_END
TIMER_WAIT
TIMER_START
END_EVENT_ID
TIMER_WAIT
N
在end_event_id无效timer_wait > N
ENABLED
YES
setup_instruments
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments;
--------------------------------------------------- --------- ------- |名字|启用|定时| --------------------------------------------------- --------- -------…|等待/同步/互斥/ SQL / lock_global_read_lock |是|是|等待/同步/互斥| / SQL / lock_global_system_variables |是|是|等待/同步/互斥| / SQL / lock_lock_db |是|是| |等待/同步/互斥/ SQL / lock_manager |是|是|…
setup_instruments
setup_consumers
MySQL的> SELECT * FROM setup_consumers;
---------------------------------- --------- |名字|启用| ---------------------------------- --------- | events_stages_current |没有| | events_stages_history |没有| | events_stages_history_long |没有| | events_statements_current |是| | events_statements_history |是| | events_statements_history_long |没有| | events_transactions_current |是| | events_transactions_history |是| | events_transactions_history_long |没有| | events_waits_current |没有| | events_waits_history |没有| | events_waits_history_long |没有| | global_instrumentation |是| | thread_instrumentation |是| | statements_digest |是| ---------------------------------- ---------
WHERE
setup_instruments
setup_objects
threads
setup_actors
setup_consumers
setup_consumers
setup_actors
TRUNCATE TABLE
NULL
setup_instruments
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments;
--------------------------------------------------- --------- ------- |名字|启用|定时| --------------------------------------------------- --------- -------…|阶段/ SQL /结束|没有|没有| |阶段/ SQL执行|没有|没有| |阶段/ SQL /初始化|没有|没有| |阶段/ SQL /插入|没有|没有|…|声明/ SQL /负载|是|是| |声明/ SQL /格兰特|是|是| |声明/ SQL /检查|是|是| |声明/ SQL /冲洗|是|是|…|等待/同步/互斥/ SQL / lock_global_read_lock |是|是|等待/同步/互斥| / SQL / lock_global_system_variables |是|是|等待/同步/互斥| / SQL / lock_lock_db |是|是| |等待/同步/互斥/平方信用证是lock_manager | |是|…|等待/同步/ rwlock / SQL / lock_grant |是|是| |等待/同步/ rwlock / SQL /记录器::lock_logger |是|是| |等待/同步/ rwlock / SQL / lock_sys_init_connect |是|是| |等待/同步/ rwlock / SQL / lock_sys_init_slave |是|是|…|等待/ IO /文件/数据库/ binlog |是|是| |等待/ IO /文件/数据库/ binlog_index |是|是| |等待/ IO /文件/数据库/用例|是|是| |等待/ IO /文件/数据库/ dbopt |是|是|…
ENABLED
NO
YES
TIMED
setup_instruments
setup_instruments
setup_instruments
LIKE
mysql> UPDATE setup_instruments SET ENABLED = 'NO';
mysql>UPDATE setup_instruments SET ENABLED = 'NO'
WHERE NAME LIKE 'wait/io/file/%';
mysql>UPDATE setup_instruments
SET ENABLED = IF(NAME LIKE 'wait/io/file/%', 'NO', 'YES');
mysys
MySQL的> UPDATE setup_instruments
SET ENABLED = CASE WHEN NAME LIKE '%/mysys/%' THEN 'YES' ELSE 'NO' END;
mysql>UPDATE setup_instruments SET ENABLED = 'NO'
WHERE NAME = 'wait/synch/mutex/mysys/TMPDIR_mutex';
ENABLED
MySQL的> UPDATE setup_instruments
SET ENABLED = IF(ENABLED = 'YES', 'NO', 'YES')
WHERE NAME = 'wait/synch/mutex/mysys/TMPDIR_mutex';
mysql> UPDATE setup_instruments SET TIMED = 'NO';
setup_objects
setup_objects
MySQL的> SELECT * FROM setup_objects;
------------- -------------------- ------------- --------- ------- | object_type | object_schema | object_name |启用|定时| ------------- -------------------- ------------- --------- ------- |事件| MySQL | % |没有|没有| |事件| performance_schema | % |没有|没有| |事件| information_schema | % |没有|没有| |事件| % % |是|是| | |功能| MySQL | % |没有|没有| |功能| performance_schema | % |没有|没有| |功能| information_schema | % |没有|没有| |功能| % | % |是|是| |程序| MySQL | % |没有|没有| |程序| performance_schema | % |没有|没有| |程序| information_schema | % |没有|没有| |程序| % | % |是|是| | TABLE | MySQL | % |没有|没有| |表| performance_schema | % |没有|没有| |表| information_schema | % |没有|没有| |表| % | % |是|是| |触发| MySQL | % |没有|没有| |触发| performance_schema | % |没有|没有| |触发| information_schema | % |没有|没有| |触发| % | % |是|是| ------------- -------------------- ------------- --------- -------
setup_objects
OBJECT_TYPE
wait/io/table/sql/handler
OBJECT_SCHEMA
'%'
ENABLED
TIMED
mysql
performance_schema
setup_objects
setup_objects
OBJECT_SCHEMA='
literal
'OBJECT_NAME='
literal
OBJECT_SCHEMA='
literal
'OBJECT_NAME='%'
OBJECT_SCHEMA='%'
OBJECT_NAME='%'
db1.t1
'db1'
'db1'
'%'
setup_objects
TIMED
setup_objects
setup_instruments
setup_objects
YES
setup_instruments
setup_objects
TIMED
ENABLED
setup_objects
setup_instruments
setup_objects
db1
db3
------------- --------------- ------------- --------- ------- | object_type | object_schema | object_name |启用|定时| ------------- --------------- ------------- --------- ------- |表| DB1 | T1 |是|是| |表| DB1 | T2 |没有|没有| |表| DB2 | % |是|是| |表| db3 | % |没有|没有| |表| % | % |是|是| ------------- --------------- ------------- --------- -------
setup_instruments
NO
YES
setup_objects
db1.t1
db1.t2
db2.t3
db3.t4
db4.t5
TIMED
setup_instruments
setup_objects
setup_objects
threads
thread_instrumentation
setup_consumers
threads.INSTRUMENTED
setup_instruments
threads
events_waits_historyevents_waits_history_longevents_stages_historyevents_stages_history_longevents_statements_historyevents_statements_history_longevents_transactions_historyevents_transactions_history_long
setup_consumers
events_waits_history
events_waits_history_long
events_waits_history_long
threads.HISTORY
setup_instruments
INSTRUMENTED
threads
setup_actors
HISTORY
setup_actors
INSTRUMENTED
YES
setup_actors
setup_actors
MySQL的> SELECT * FROM setup_actors;
------ ------ ------ --------- --------- |主机|用户|作用|启用|历史| ------ ------ ------ --------- --------- | % % % | | |是|是| ------ ------ ------ --------- ---------
HOST
'%'
ENABLED
setup_actors
HOST
USER='
literal
'HOST='
literal
USER='
literal
'HOST='%'
USER='%'
HOST='
literal
USER='%'
HOST='%'
setup_actors
HOST
HISTORY
ENABLED=YES
YES
HISTORY=YES
HISTORY
ENABLED=NO
NO
HISTORY=NO
HISTORY
INSTRUMENTED
NO
ENABLED
setup_actors
NO
setup_actors
HOST
HOST
setup_actors
UPDATE setup_actors SET ENABLED = 'NO', HISTORY = 'NO'WHERE HOST = '%' AND USER = '%';INSERT INTO setup_actors (HOST,USER,ROLE,ENABLED,HISTORY)VALUES('localhost','joe','%','YES','YES');INSERT INTO setup_actors (HOST,USER,ROLE,ENABLED,HISTORY)VALUES('hosta.example.com','joe','%','YES','NO');INSERT INTO setup_actors (HOST,USER,ROLE,ENABLED,HISTORY)VALUES('%','sam','%','NO','YES');
UPDATE
INSERT
INSTRUMENTED
joe
HISTORY
joe
INSTRUMENTED
HISTORY
joe
HISTORY
sam
NO
YES
HOST
'%'
HISTORY
INSTRUMENTED
NO
setup_actors
HISTORY
threads
setup_consumers
MySQL的> SELECT * FROM setup_consumers;
---------------------------------- --------- |名字|启用| ---------------------------------- --------- | events_stages_current |没有| | events_stages_history |没有| | events_stages_history_long |没有| | events_statements_current |是| | events_statements_history |是| | events_statements_history_long |没有| | events_transactions_current |是| | events_transactions_history |是| | events_transactions_history_long |没有| | events_waits_current |没有| | events_waits_history |没有| | events_waits_history_long |没有| | global_instrumentation |是| | thread_instrumentation |是| | statements_digest |是| ---------------------------------- ---------
setup_consumers
YES
setup_consumers
mysql>UPDATE setup_consumers
SET ENABLED = 'NO' WHERE NAME LIKE '%history%';
setup_consumers
global_instrumentation
NO
YES
thread_instrumentation
YES
NO
YES
xxx
global_instrumentation
YES
events_waits_current
events_waits_current
events_waits_history
events_waits_history
NO
NO
events_waits_history
events_waits_history_long
NO
NO
events_waits_history_long
global_instrumentation
YES
events_stages_current
events_stages_current
events_stages_history
events_stages_history
NO
NO
events_stages_history
events_stages_history_long
NO
NO
events_stages_history_long
global_instrumentation
YES
events_statements_current
events_statements_current
events_statements_history
events_statements_history
NO
NO
events_statements_history
events_statements_history_long
NO
NO
events_statements_history_long
global_instrumentation
YES
events_transactions_current
events_transactions_current
events_transactions_history
events_transactions_history
NO
NO
events_transactions_history
events_transactions_history_long
NO
NO
events_transactions_history_long
statements_digest
YES
events_statements_current
events_statements_current
DIGEST_TEXT
setup_consumers
setup_consumers
global_instrumentation thread_instrumentation events_waits_current events_waits_history events_waits_history_long events_stages_current events_stages_history events_stages_history_long events_statements_current events_statements_history events_statements_history_long events_transactions_current events_transactions_history events_transactions_history_long statements_digest
NO
global_instrumentation
thread_instrumentation
xxx
events_waits_history
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | NO |
...
+---------------------------+---------+
setup_consumers
mysql> SELECT * FROM setup_consumers;
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | NO |
...
+---------------------------+---------+
setup_consumers
mysql> SELECT * FROM setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | NO |
...
| events_stages_current | NO |
...
| events_statements_current | NO |
...
| events_transactions_current | NO |
...
+----------------------------------+---------+
setup_consumers
xxx
xxx
stages
transactions
threads.instrumented
events_
xxx
_summary_by_yyy
_by_event_namexxx
stages
transactions
yyy
user
account
mysql> SELECT * FROM setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | NO |
| events_waits_history_long | NO |
| events_stages_current | YES |
| events_stages_history | NO |
| events_stages_history_long | NO |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | NO |
| events_transactions_current | YES |
| events_transactions_history | YES |
| events_transactions_history_long | NO |
...
+----------------------------------+---------+
events_
xxx
_historyxxx
stages
transactions
events_
xxx
_history_longxxx
stages
transactions
events_
xxx
_currentxxx
stages
transactions
events_
xxx
_historyxxx
mysql> SELECT * FROM setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | YES |
| events_waits_history_long | NO |
| events_stages_current | YES |
| events_stages_history | YES |
| events_stages_history_long | NO |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | NO |
| events_transactions_current | YES |
| events_transactions_history | YES |
| events_transactions_history_long | NO |
...
+----------------------------------+---------+
events_
xxx
_historyxxx
stages
transactions
mysql> SELECT * FROM setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | NO |
| events_waits_history_long | YES |
| events_stages_current | YES |
| events_stages_history | NO |
| events_stages_history_long | YES |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | YES |
| events_transactions_current | YES |
| events_transactions_history | YES |
| events_transactions_history_long | YES |
...
+----------------------------------+---------+
events_
xxx
_history_longxxx
stages
transactions
mysql> SELECT * FROM setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| global_instrumentation | YES |
| thread_instrumentation | YES |
| events_waits_current | YES |
| events_waits_history | YES |
| events_waits_history_long | YES |
| events_stages_current | YES |
| events_stages_history | YES |
| events_stages_history_long | YES |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | YES |
| events_transactions_current | YES |
| events_transactions_history | YES |
| events_transactions_history_long | YES |
...
+----------------------------------+---------+
events_
xxx
_historyxxx
stages
transactions
events_
xxx
_history_longxxx
stages
transactions
mysql>UPDATE setup_instruments
SET ENABLED = 'NO'
WHERE NAME = 'wait/synch/mutex/myisammrg/MYRG_INFO::mutex';
mysql>UPDATE setup_consumers
SET ENABLED = 'NO' WHERE NAME = 'events_waits_current';
mysql>UPDATE setup_instruments
SET ENABLED = 'NO'
WHERE NAME LIKE 'wait/synch/mutex/%';
mysql>UPDATE setup_consumers
SET ENABLED = 'NO' WHERE NAME LIKE '%history%';
... WHERE NAME LIKE 'wait/io/file/%';
'%/file/%'
'%file%'
wait/synch/mutex/innodb/file_open_mutex
mysql>SELECT NAME FROM setup_instruments WHERE NAME LIKE '
mysql>pattern
';SELECT NAME FROM setup_consumers WHERE NAME LIKE '
pattern
';
setup_instruments
mysql>SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME LIKE 'wait/io/file/innodb/%';
+-------------------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +-------------------------------------------------+---------+-------+ | wait/io/file/innodb/innodb_tablespace_open_file | YES | YES | | wait/io/file/innodb/innodb_data_file | YES | YES | | wait/io/file/innodb/innodb_log_file | YES | YES | | wait/io/file/innodb/innodb_temp_file | YES | YES | | wait/io/file/innodb/innodb_arch_file | YES | YES | | wait/io/file/innodb/innodb_clone_file | YES | YES | +-------------------------------------------------+---------+-------+
setup_instruments
WHERE
WHERE
MySQL的> SELECT THREAD_ID, NUMBER_OF_BYTES
FROM events_waits_history
WHERE EVENT_NAME LIKE 'wait/io/file/%'
AND NUMBER_OF_BYTES IS NOT NULL;
----------- ----------------- | thread_id | number_of_bytes | ----------- ----------------- | 11 | 66 | | 11 | 47 | | 11 | 139 | | 5 | 24 | | 5 | 834 | ----------- -----------------
sys
'/'
等待IO / / / / / logwait MyISAM文件IO /文件/ mysys charsetwait /锁/表/ / / / / handlerwait SQL同步mysys /条件/条件/条件/ _ alarmwait /同步:更新SQL / binlog _ condwait /同步/互斥mysys位图/ / / / / _ mutexwait SQL同步互斥_ deletewait /锁/ / / / rwlock同步SQL查询缓存的查询:_ _:lockstage / / / /关闭tablesstage SQL SQL排序resultstatement executestatement / COM / COM / / / / _ tablestatement querystatement创建SQL SQL /锁/ _ tableserrors
myisam
wait/io/file/myisam/log wait/synch/cond/myisam/MI_SORT_INFO::cond
performance_timers
myisam
mysys
XXX
CCC
MMM
MMM
CCC
THR_LOCK_myisam
idle
error
memory
stage
statement
transaction
wait
idle
error
error
setup_instruments
ENABLED
setup_instruments
code_area
instrument_name
code_area
myisam
instrument_name
memory/performance_schema/
memory_summary_global_by_event_name
stage/
code_area
/stage_name
code_area
myisam
stage_name
Sending data
SHOW
PROCESSLIST
INFORMATION_SCHEMA.PROCESSLIST
statement/abstract/*
statement/com
xxx
sql/sql_parse.cc
statement/com/Init DB
COM_INIT_DB
statement/scheduler/event
statement/sp
statement/sp/freturn
statement/sql
statement/sql/select
CREATE DATABASE
SELECT
setup_threads
thread
thread/performance_schema/setup
wait/io
wait/io/file
fwrite()
wait/io/socket
wait/io/socket/sql/
socket_type
socket_type
server_unix_socket
socket_type
wait/io/table
events_waits_current
wait/lock
wait/lock/table
wait/lock/metadata/sql/mdl
wait/synch
TIMER_WAIT
wait/synch/cond
wait/synch/mutex
wait/synch/rwlock
wait/synch/sxlock
sxlocks
mysql> SHOW STATUS LIKE 'perf%';
+-----------------------------------------------+-------+
| Variable_name | Value |
+-----------------------------------------------+-------+
| Performance_schema_accounts_lost | 0 |
| Performance_schema_cond_classes_lost | 0 |
| Performance_schema_cond_instances_lost | 0 |
| Performance_schema_digest_lost | 0 |
| Performance_schema_file_classes_lost | 0 |
| Performance_schema_file_handles_lost | 0 |
| Performance_schema_file_instances_lost | 0 |
| Performance_schema_hosts_lost | 0 |
| Performance_schema_locker_lost | 0 |
| Performance_schema_memory_classes_lost | 0 |
| Performance_schema_metadata_lock_lost | 0 |
| Performance_schema_mutex_classes_lost | 0 |
| Performance_schema_mutex_instances_lost | 0 |
| Performance_schema_nested_statement_lost | 0 |
| Performance_schema_program_lost | 0 |
| Performance_schema_rwlock_classes_lost | 0 |
| Performance_schema_rwlock_instances_lost | 0 |
| Performance_schema_session_connect_attrs_lost | 0 |
| Performance_schema_socket_classes_lost | 0 |
| Performance_schema_socket_instances_lost | 0 |
| Performance_schema_stage_classes_lost | 0 |
| Performance_schema_statement_classes_lost | 0 |
| Performance_schema_table_handles_lost | 0 |
| Performance_schema_table_instances_lost | 0 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Performance_schema_users_lost | 0 |
+-----------------------------------------------+-------+
Performance_schema_
xxx
_classes_lostxxx
Performance_schema_
xxx
_instances_lostxxx
Performance_schema_
xxx
_handles_lostxxx
Performance_schema_locker_lost
Performance_schema_mutex_classes_lost
Performance_schema_mutex_instances_lost
--performance_schema_max_mutex_classes=200
plugin_a
plugin_b
INSTALL PLUGIN plugin_a
The server now has 150+40 = 190 mutex instruments.
UNINSTALL PLUGIN plugin_a;
INSTALL PLUGIN plugin_a;
INSTALL PLUGIN plugin_b;
The server has room for 200-190 = 10 instruments (in this case, mutex classes), and sees that the plugin contains 20 new instruments. 10 instruments are loaded, and 10 are discarded orPerformance_schema_mutex_classes_lost
MySQL的> SHOW STATUS LIKE "perf%mutex_classes_lost";
--------------------------------------- ------- | variable_name |价值| --------------------------------------- ------- | performance_schema_mutex_classes_lost |十| --------------------------------------- -------一行集(0.1秒)
plugin_b
setup_instruments
Performance_schema_mutex_instances_lost
Performance_schema_mutex_classes_lost
--performance_schema_max_mutex_classes=
N
N
performance_schema_max_mutex_classes
--performance_schema_max_mutex_classes=
N
performance_schema_max_mutex_classes
Performance_schema_mutex_classes_lost
wait/synch/mutex/sql/LOCK_delete
setup_instruments
LOCK_delete
LOCK_delete
Performance_schema_mutex_instances_lost
Performance_schema_mutex_instances_lost
--performance_schema_max_mutex_instances=
N
SHOW STATUS LIKE
'perf%'
xxx
SHOW ENGINE
PERFORMANCE_SCHEMA STATUS
MySQL的> SHOW ENGINE PERFORMANCE_SCHEMA STATUS\G
*************************** 3。行***************************型:performance_schema名称:events_waits_history.sizestatus:76 *************************** 4。行***************************型:performance_schema名称:events_waits_history.countstatus:一万五***************************。行***************************型:performance_schema名称:events_waits_history.memorystatus:76…*************************** 57。行***************************型:performance_schema名称:performance_schema.memorystatus:26459600…
events_waits_current
行# event_name timer_start timer_end ---- ---------- ----------- --------- 1等待/ IO /文件/表/ dfile 10001 10002 2等待/ IO /表/ SQL /处理10000空
TIMER_END
events_waits_current
events_waits_current
STATEMENT_DIGEST_TEXT()
STATEMENT_DIGEST()
max_digest_length
performance_schema_max_digest_length
performance_schema_max_digest_length
max_digest_length
SELECT * FROM orders WHERE customer_id=10 AND quantity>20 SELECT * FROM orders WHERE customer_id = 20 AND quantity > 100
?
SELECT * FROM orders WHERE customer_id = ? AND quantity > ?
SELECT * FROM customers WHERE customer_id = 1000 SELECT * FROM orders WHERE customer_id = 1000
SELECT * FROM customers WHERE customer_id = ? SELECT * FROM orders WHERE customer_id = ?
max_digest_length
SELECT * FROM mytable WHERE cola = 10 AND colb = 20 SELECT * FROM mytable WHERE cola = 10 AND colc = 20
AND
SELECT * FROM mytable WHERE cola = ? AND ...
statements_digest
setup_consumers
events_statements_current
events_statements_history
events_statements_history_long
DIGEST_TEXT
max_digest_length
performance_schema_max_digest_length
DIGEST
events_statements_summary_by_digest
DIGEST
SQL_TEXT
events_statements_current
events_statements_history
events_statements_history_long
QUERY_SAMPLE_TEXT
events_statements_summary_by_digest
performance_schema_max_sql_text_length
performance_schema_max_digest_length
performance_schema_max_digest_length
events_statements_summary_by_digest
events_statements_summary_by_digest
performance_schema_digests_size
DIGEST
DIGEST
performance_schema_digests_size
max_digest_length
max_digest_length
max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
max_digest_length
performance_schema_max_digest_length
max_digest_length
SHOW ENGINE
PERFORMANCE_SCHEMA STATUS
MySQL的> SELECT NAME FROM setup_instruments
WHERE NAME LIKE '%.sqltext';
------------------------------------------------------------------ | name | ------------------------------------------------------------------ |存储器的性能_ /模式/事件_ statements _ history.sqltext | |存储器的性能_ /模式/事件_ statements _ current.sqltext | |存储器的性能_ /模式/事件_ statements _史_ long.sqltext | ------------------------------------------------------------------ MySQL > SELECT NAME FROM setup_instruments
WHERE NAME LIKE 'memory/performance_schema/%.tokens';
---------------------------------------------------------------------- | name | ---------------------------------------------------------------------- |存储器的性能_ /模式/事件_ statements _ history.tokens | |存储器的性能_ /模式/事件_ statements _ current.tokens | |存储器的性能_ /模式/事件_ statements _总结_用_ digest.tokens | |存储器的性能_ /模式/事件_ statements _史_ long.tokens | ----------------------------------------------------------------------
events_statements_summary_by_digest
QUERY_SAMPLE_SEEN
performance_schema_max_digest_sample_age
performance_schema_max_digest_sample_age
performance_schema_max_digest_sample_age
performance_schema
performance_schema
MySQL的> TRUNCATE TABLE setup_instruments;
错误1683(hy000):无效的performance_schema用法。
TRUNCATE TABLE
TRUNCATE
TABLE
GRANT ALL
MySQL的> GRANT ALL ON performance_schema.*
TO 'u1'@'localhost';
错误1044(42000):用户访问被拒绝'根'”'localhost'to数据库performance_schema'mysql > GRANT ALL ON performance_schema.setup_instruments
TO 'u2'@'localhost';
错误1044(42000):用户访问被拒绝'根'”'localhost'to数据库performance_schema”
mysql>GRANT SELECT ON performance_schema.*
TO 'u1'@'localhost';
Query OK, 0 rows affected (0.03 sec) mysql>GRANT SELECT, UPDATE ON performance_schema.setup_instruments
TO 'u2'@'localhost';
Query OK, 0 rows affected (0.02 sec)
performance_schema
events_waits_current
events_stages_current
events_statements_current
events_transactions_current
events_waits_history
events_waits_history_long
performance_schema_events_waits_history_size
performance_schema_events_waits_history_long_size
UPDATE
setup_actors
setup_consumers
setup_instruments
setup_objects
setup_threads
setup_actors
performance_schema_setup_actors_size
setup_actors
HISTORY
HISTORY
threads
HISTORY
INSTRUMENTED
YES
setup_actors
setup_actors
MySQL的> SELECT * FROM setup_actors;
------ ------ ------ --------- --------- |主机|用户|作用|启用|历史| ------ ------ ------ --------- --------- | % % % | | |是|是| ------ ------ ------ --------- ---------
setup_actors
setup_actors
HISTORY
threads
setup_actors
HOST
'%'
USER
'%'
ROLE
ENABLED
YES
HISTORY
YES
setup_actors
HOST
ROLE
TRUNCATE TABLE
setup_actors
setup_consumers
MySQL的> SELECT * FROM setup_consumers;
---------------------------------- --------- |名字|启用| ---------------------------------- --------- | events_stages_current |没有| | events_stages_history |没有| | events_stages_history_long |没有| | events_statements_current |是| | events_statements_history |是| | events_statements_history_long |没有| | events_transactions_current |是| | events_transactions_history |是| | events_transactions_history_long |没有| | events_waits_current |没有| | events_waits_history |没有| | events_waits_history_long |没有| | global_instrumentation |是| | thread_instrumentation |是| | statements_digest |是| ---------------------------------- ---------
setup_consumers
setup_consumers
setup_consumers
NAME
ENABLED
YES
setup_consumers
NAME
setup_instruments
MySQL的> SELECT * FROM setup_instruments\G
*************************** 1。行***************************名称:等待/同步/互斥/铁/ lock_pfs_share_list启用:不定时:无属性:单身波动:1documentation:组件可以提供自己的performance_schema表。这锁保护这些表定义的…*************************** 369名单。行***************************名称:阶段/ SQL执行启用:不定时:无属性:波动:0documentation:空…*************************** 687。行***************************名称:声明/摘要/查询功能:可以定时:是的特性:易变的波动:0documentation:SQL查询刚刚收到来自网络。在这一点上,真正的声明类型是未知的,该类型将SQL解析的…*************************** 696精制后。行***************************名称:记忆/ performance_schema / metadata_locks启用:是定时:空的属性:global_statistics波动:1documentation:用于表performance_schema metadata_locks记忆…
setup_instruments
xxx
file_instances
rwlock_instances
setup_instruments
setup_instruments
setup_instruments
NAME
EVENT_NAME
ENABLED
YES
ENABLED
TIMED
YES
NULL
TIMED
TIMED
TIMED
TIMED
NULL
TIMER_END
PROPERTIES
SET
global_statistics
mutable
progress
singleton
user
VOLATILITY
PSI_VOLATILITY_
xxx
#define PSI_VOLATILITY_UNKNOWN 0 #define PSI_VOLATILITY_PERMANENT 1 #define PSI_VOLATILITY_PROVISIONING 2 #define PSI_VOLATILITY_DDL 3 #define PSI_VOLATILITY_CACHE 4 #define PSI_VOLATILITY_SESSION 5 #define PSI_VOLATILITY_TRANSACTION 6 #define PSI_VOLATILITY_QUERY 7 #define PSI_VOLATILITY_INTRA_QUERY 8
VOLATILITY
Instruments with a low volatility index (PERMANENT = 1) are created once at server startup, and never destroyed or re-created during normal server operation. They are destroyed only during server shutdown.
wait/synch/mutex/pfs/LOCK_pfs_share_list
Instruments with a higher volatility index (for example, SESSION = 5) are created and destroyed for every user session. For example, thewait/synch/mutex/sql/THD::LOCK_query_plan
ENABLED
ENABLED
setup_instruments
LOCK_query_plan
UPDATE setup_instruments SET ENABLED=value
WHERE NAME = 'wait/synch/mutex/sql/THD::LOCK_query_plan';
UPDATE setup_instruments SET ENABLED=value
WHERE NAME = 'wait/synch/mutex/pfs/LOCK_pfs_share_list';
ENABLED
setup_instruments
mutex_instances
DOCUMENTATION
NULL
setup_instruments
NAME
setup_objects
performance_schema_setup_objects_size
setup_objects
MySQL的> SELECT * FROM setup_objects;
------------- -------------------- ------------- --------- ------- | object_type | object_schema | object_name |启用|定时| ------------- -------------------- ------------- --------- ------- |事件| MySQL | % |没有|没有| |事件| performance_schema | % |没有|没有| |事件| information_schema | % |没有|没有| |事件| % % |是|是| | |功能| MySQL | % |没有|没有| |功能| performance_schema | % |没有|没有| |功能| information_schema | % |没有|没有| |功能| % | % |是|是| |程序| MySQL | % |没有|没有| |程序| performance_schema | % |没有|没有| |程序| information_schema | % |没有|没有| |程序| % | % |是|是| | TABLE | MySQL | % |没有|没有| |表| performance_schema | % |没有|没有| |表| information_schema | % |没有|没有| |表| % | % |是|是| |触发| MySQL | % |没有|没有| |触发| performance_schema | % |没有|没有| |触发| information_schema | % |没有|没有| |触发| % | % |是|是| ------------- -------------------- ------------- --------- -------
setup_objects
setup_objects
OBJECT_NAME
mysql
performance_schema
setup_objects
setup_objects
'db1'
'db1'
'%'
setup_objects
TIMED
setup_objects
INSERT
DELETE
TIMED
UPDATE
setup_objects
setup_objects
OBJECT_TYPE
'EVENT'
'PROCEDURE'
'TRIGGER'
TABLE
wait/lock/table/sql/handler
OBJECT_SCHEMA
'%'
OBJECT_NAME
'%'
ENABLED
YES
TIMED
setup_objects
OBJECT_TYPE
OBJECT_NAME
TRUNCATE TABLE
setup_objects
setup_threads
MySQL的> SELECT * FROM setup_threads;
*************************** 1。行***************************名称:螺纹/ performance_schema /设置启用:是的历史:是的性质:辛格尔顿波动:0documentation:空…*************************** 4。行***************************名称:螺纹/ SQL /主要功能:是的历史:是的性质:辛格尔顿波动:0documentation:空*************************** 5。行***************************名称:螺纹/ SQL / one_connection启用:是的历史:是的特性:用户波动:0documentation:空…*************************** 10。行***************************名称:螺纹/ SQL / event_scheduler启用:是的历史:是的性质:辛格尔顿波动:0documentation:空
setup_threads
NAME
thread
thread/performance_schema/setup
ENABLED
YES
ENABLED
ENABLED
YES
threads
setup_actors
HISTORY
YES
HISTORY
HISTORY
YES
threads
setup_actors
PROPERTIES
SET
singleton
user
user
VOLATILITY
setup_instruments
DOCUMENTATION
NULL
setup_threads
NAME
cond_instances
file_instances
mutex_instances
rwlock_instances
socket_instances
cond
rwlock
NAME
mutex_instances.LOCKED_BY_THREAD_ID
cond_instances
cond_instances
NAME
OBJECT_INSTANCE_BEGIN
cond_instances
OBJECT_INSTANCE_BEGIN
NAME
file_instances
file_instances
file_instances
file_instances
FILE_NAME
EVENT_NAME
OPEN_COUNT
OPEN_COUNT
file_instances
FILE_NAME
EVENT_NAME
mutex_instances
mutex_instances
NAME
OBJECT_INSTANCE_BEGIN
LOCKED_BY_THREAD_ID
LOCKED_BY_THREAD_ID
NULL
mutex_instances
OBJECT_INSTANCE_BEGIN
NAME
LOCKED_BY_THREAD_ID
TRUNCATE TABLE
mutex_instances
setup_instruments
mutex_instances
events_waits_current
OBJECT_INSTANCE_BEGIN
events_waits_current
TIMER_WAIT
events_waits_history
events_waits_history_long
mutex_instances
mutex_instances
NULL
mutex_instances
events_waits_current
mutex_instances
rwlock_instances
rwlock
rwlock
rwlock_instances
NAME
OBJECT_INSTANCE_BEGIN
WRITE_LOCKED_BY_THREAD_ID
rwlock
THREAD_ID
READ_LOCKED_BY_COUNT
rwlock
rwlock
rwlock_instances
OBJECT_INSTANCE_BEGIN
NAME
WRITE_LOCKED_BY_THREAD_ID
TRUNCATE TABLE
rwlock_instances
events_waits_current
rwlock_instances
rwlock_instances
socket_instances
mysql> SELECT * FROM socket_instances\G
*************************** 1. row ***************************
EVENT_NAME: wait/io/socket/sql/server_unix_socket
OBJECT_INSTANCE_BEGIN: 4316619408
THREAD_ID: 1
SOCKET_ID: 16
IP:
PORT: 0
STATE: ACTIVE
*************************** 2. row ***************************
EVENT_NAME: wait/io/socket/sql/client_connection
OBJECT_INSTANCE_BEGIN: 4316644608
THREAD_ID: 21
SOCKET_ID: 39
IP: 127.0.0.1
PORT: 55233
STATE: ACTIVE
*************************** 3. row ***************************
EVENT_NAME: wait/io/socket/sql/server_tcpip_socket
OBJECT_INSTANCE_BEGIN: 4316699040
THREAD_ID: 1
SOCKET_ID: 14
IP: 0.0.0.0
PORT: 50603
STATE: ACTIVE
wait/io/socket/sql/
socket_type
socket_type
server_unix_socket
socket_type
socket_instances
socket_instances
EVENT_NAME
wait/io/socket/*
setup_instruments
OBJECT_INSTANCE_BEGIN
THREAD_ID
SOCKET_ID
IP
PORT
STATE
IDLE
idle
socket_instances
IDLE
wait/io/socket/*
events_waits_current
idle
idle
ACTIVE
socket_instances
OBJECT_INSTANCE_BEGIN
THREAD_ID
SOCKET_ID
IP
TRUNCATE TABLE
socket_instances
IP:PORT
events_waits_
xxx
server_unix_socket
client_connection
server_tcpip_socket
client_connection
::1
events_waits_current
events_waits_history
events_waits_history_long
setup_instruments
setup_consumers
mysql>SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME LIKE 'wait/io/file/innodb%';
+-------------------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +-------------------------------------------------+---------+-------+ | wait/io/file/innodb/innodb_tablespace_open_file | YES | YES | | wait/io/file/innodb/innodb_data_file | YES | YES | | wait/io/file/innodb/innodb_log_file | YES | YES | | wait/io/file/innodb/innodb_temp_file | YES | YES | | wait/io/file/innodb/innodb_arch_file | YES | YES | | wait/io/file/innodb/innodb_clone_file | YES | YES | +-------------------------------------------------+---------+-------+ mysql>SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME LIKE 'wait/io/socket/%';
+----------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +----------------------------------------+---------+-------+ | wait/io/socket/sql/server_tcpip_socket | NO | NO | | wait/io/socket/sql/server_unix_socket | NO | NO | | wait/io/socket/sql/client_connection | NO | NO | +----------------------------------------+---------+-------+
mysql> SELECT * FROM setup_consumers WHERE NAME LIKE '%waits%';
+---------------------------+---------+
| NAME | ENABLED |
+---------------------------+---------+
| events_waits_current | NO |
| events_waits_history | NO |
| events_waits_history_long | NO |
+---------------------------+---------+
my.cnf
[mysqld] performance-schema-instrument='wait/%=ON' performance-schema-consumer-events-waits-current=ON performance-schema-consumer-events-waits-history=ON performance-schema-consumer-events-waits-history-long=ON
[mysqld] performance-schema-instrument='wait/%=OFF' performance-schema-consumer-events-waits-current=OFF performance-schema-consumer-events-waits-history=OFF performance-schema-consumer-events-waits-history-long=OFF
setup_instruments
setup_consumers
UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'wait/%'; UPDATE setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%waits%';
UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'wait/%'; UPDATE setup_consumers SET ENABLED = 'NO' WHERE NAME LIKE '%waits%';
events_waits_current
events_waits_current
events_waits_history
events_waits_history_long
events_waits_current
THREAD_ID
THREAD_ID
END_EVENT_ID
NULL
EVENT_NAME
NAME
setup_instruments
SOURCE
TIMER_START
TIMER_WAIT
TIMER_START
TIMER_WAIT
TIMER_END
TIMER_END
TIMED = NO
TIMER_END
NULL
SPINS
NULL
OBJECT_SCHEMA
OBJECT_TYPE
cond
rwlock
OBJECT_SCHEMA
OBJECT_TYPE
OBJECT_INSTANCE_BEGIN
OBJECT_SCHEMA
OBJECT_NAME
OBJECT_TYPE
OBJECT_INSTANCE_BEGIN
OBJECT_NAME
OBJECT_INSTANCE_BEGIN
OBJECT_SCHEMA
OBJECT_NAME
OBJECT_TYPE
TEMPORARY TABLE
OBJECT_INSTANCE_BEGIN
OBJECT_INSTANCE_BEGIN
GROUP
BY OBJECT_INSTANCE_BEGIN
INDEX_NAME
PRIMARY
NESTING_EVENT_ID
EVENT_ID
NESTING_EVENT_TYPE
TRANSACTION
STAGE
OPERATION
lock
write
NUMBER_OF_BYTES
wait/io/table/sql/handler
t1
t3
选择从T1和T2…加入T3…
t3
t2
t3
10 + (10 * 20) + (10 * 20 * 30) = 6210
t1
t3
10 + (10 * 20) + (10 * 20) = 410
eq_ref
FLAGS
events_waits_current
THREAD_ID
TRUNCATE TABLE
events_waits_current
events_waits_history
N
N
performance_schema_events_waits_history_size
events_waits_history
events_waits_current
TRUNCATE TABLE
events_waits_history
events_waits_history_long
N
N
performance_schema_events_waits_history_long_size
events_waits_history_long
events_waits_current
TRUNCATE TABLE
events_waits_history_long
filesort
SHOW
PROCESSLIST
INFORMATION_SCHEMA.PROCESSLIST
events_stages_history
events_stages_history_long
setup_instruments
setup_consumers
mysql>SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME RLIKE 'stage/sql/[a-c]';
+----------------------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +----------------------------------------------------+---------+-------+ | stage/sql/After create | NO | NO | | stage/sql/allocating local table | NO | NO | | stage/sql/altering table | NO | NO | | stage/sql/committing alter table to storage engine | NO | NO | | stage/sql/Changing master | NO | NO | | stage/sql/Checking master version | NO | NO | | stage/sql/checking permissions | NO | NO | | stage/sql/cleaning up | NO | NO | | stage/sql/closing tables | NO | NO | | stage/sql/Connecting to master | NO | NO | | stage/sql/converting HEAP to MyISAM | NO | NO | | stage/sql/Copying to group table | NO | NO | | stage/sql/Copying to tmp table | NO | NO | | stage/sql/copy to tmp table | NO | NO | | stage/sql/Creating sort index | NO | NO | | stage/sql/creating table | NO | NO | | stage/sql/Creating tmp table | NO | NO | +----------------------------------------------------+---------+-------+
mysql>SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE ENABLED='YES' AND NAME LIKE "stage/%";
+------------------------------------------------------+---------+-------+ | NAME | ENABLED | TIMED | +------------------------------------------------------+---------+-------+ | stage/sql/copy to tmp table | YES | YES | | stage/sql/Applying batch of row changes (write) | YES | YES | | stage/sql/Applying batch of row changes (update) | YES | YES | | stage/sql/Applying batch of row changes (delete) | YES | YES | | stage/innodb/alter table (end) | YES | YES | | stage/innodb/alter table (flush) | YES | YES | | stage/innodb/alter table (insert) | YES | YES | | stage/innodb/alter table (log apply index) | YES | YES | | stage/innodb/alter table (log apply table) | YES | YES | | stage/innodb/alter table (merge sort) | YES | YES | | stage/innodb/alter table (read PK and internal sort) | YES | YES | | stage/innodb/buffer pool load | YES | YES | | stage/innodb/clone (file copy) | YES | YES | | stage/innodb/clone (redo copy) | YES | YES | | stage/innodb/clone (page copy) | YES | YES | +------------------------------------------------------+---------+-------+
mysql> SELECT * FROM setup_consumers WHERE NAME LIKE '%stages%';
+----------------------------+---------+
| NAME | ENABLED |
+----------------------------+---------+
| events_stages_current | NO |
| events_stages_history | NO |
| events_stages_history_long | NO |
+----------------------------+---------+
my.cnf
[mysqld] performance-schema-instrument='stage/%=ON' performance-schema-consumer-events-stages-current=ON performance-schema-consumer-events-stages-history=ON performance-schema-consumer-events-stages-history-long=ON
[mysqld] performance-schema-instrument='stage/%=OFF' performance-schema-consumer-events-stages-current=OFF performance-schema-consumer-events-stages-history=OFF performance-schema-consumer-events-stages-history-long=OFF
setup_instruments
setup_consumers
UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'stage/%'; UPDATE setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%stages%';
UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'stage/%'; UPDATE setup_consumers SET ENABLED = 'NO' WHERE NAME LIKE '%stages%';
WORK_COMPLETED
WORK_ESTIMATED
NULL
WORK_COMPLETED
WORK_ESTIMATED
WORK_COMPLETED
NULL
WORK_COMPLETED
events_stages_current
WORK_COMPLETED
events_stages_current
WORK_ESTIMATED
stage/sql/copy to tmp table
ALTER TABLE
stage/sql/copy to tmp table
WORK_ESTIMATED
UPDATE setup_instruments SET ENABLED='YES' WHERE NAME='stage/sql/copy to tmp table'; UPDATE setup_consumers SET ENABLED='YES' WHERE NAME LIKE 'events_stages_%';
ALTER
TABLE
events_stages_current
events_stages_current
events_stages_current
events_stages_history
events_stages_history_long
events_stages_current
THREAD_ID
THREAD_ID
END_EVENT_ID
NULL
EVENT_NAME
NAME
setup_instruments
SOURCE
TIMER_START
TIMER_WAIT
TIMER_START
TIMER_WAIT
TIMER_END
TIMER_END
TIMED = NO
TIMER_END
NULL
WORK_COMPLETED
WORK_COMPLETED
NESTING_EVENT_ID
EVENT_ID
NESTING_EVENT_TYPE
TRANSACTION
STAGE
events_stages_current
THREAD_ID
TRUNCATE TABLE
events_stages_current
events_stages_history
N
N
performance_schema_events_stages_history_size
events_stages_history
events_stages_current
TRUNCATE TABLE
events_stages_history
events_stages_history_long
N
N
performance_schema_events_stages_history_long_size
events_stages_history_long
events_stages_current
TRUNCATE TABLE
events_stages_history_long
events_statements_current
events_statements_history
events_statements_history_long
prepared_statements_instances
setup_instruments
setup_consumers
events_statements_current
statements_digest
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME LIKE 'statement/%';
--------------------------------------------- --------- ------- |名字|启用|定时| --------------------------------------------- --------- ------- |声明/ SQL /选择|是|是| |声明/ SQL / create_table |是|是| |声明/ SQL / create_index |是|是|…|声明/ SP /支撑|是|是| |声明/ SP /套|是|是| |声明/ SP / set_trigger_field |是|是| |声明/调度/事件|是|是| |声明/ COM /睡眠|是|是| |声明/ COM /退出|是|是| |声明/ COM /初始化数据库|是|是| |声明…/摘要/查询|是|是| |声明/摘要/ new_packet |是|是| |声明/摘要/ relay_log|是|是| --------------------------------------------- --------- -------
MySQL的> SELECT * FROM setup_consumers WHERE NAME LIKE '%statements%';
-------------------------------- --------- |名字|启用| -------------------------------- --------- | events_statements_current |是| | events_statements_history |是| | events_statements_history_long |没有| | statements_digest |是| -------------------------------- ---------
my.cnf
[mysqld] performance-schema-instrument='statement/%=ON' performance-schema-consumer-events-statements-current=ON performance-schema-consumer-events-statements-history=ON performance-schema-consumer-events-statements-history-long=ON performance-schema-consumer-statements-digest=ON
[mysqld] performance-schema-instrument='statement/%=OFF' performance-schema-consumer-events-statements-current=OFF performance-schema-consumer-events-statements-history=OFF performance-schema-consumer-events-statements-history-long=OFF performance-schema-consumer-statements-digest=OFF
setup_instruments
setup_consumers
UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'statement/%'; UPDATE setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%statements%';
UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME LIKE 'statement/%'; UPDATE setup_consumers SET ENABLED = 'NO' WHERE NAME LIKE '%statements%';
COM_
xxx
codessql/sql_parse.cc
COM_QUIT
statement/com/Ping
DELETE FROM t1
statement/sql
statement/sql/select
statement/com/Error
statement/sql/error
statement/sql/error
No tables used
statement/abstract/new_packet
COM_PING
COM_QUERY
INSERT
statement/sql/insert
statement/abstract/new_packet
INSERT
statement/sql/insert
statement/scheduler/event
statement/sql/*
INSERT
INSERT
statement/sql/*
INSERT
statement/abstract/new_packet
statement/abstract/relay_log
statement/abstract/Query
events_statements_current
events_statements_current
events_statements_history
events_statements_history_long
events_statements_current
THREAD_ID
THREAD_ID
END_EVENT_ID
NULL
EVENT_NAME
NAME
setup_instruments
EVENT_NAME
SOURCE
TIMER_START
TIMER_WAIT
TIMER_START
TIMER_WAIT
TIMER_END
TIMER_END
TIMED = NO
TIMER_END
NULL
LOCK_TIME
SQL_TEXT
NULL
performance_schema_max_sql_text_length
DIGEST
NULL
no
DIGEST_TEXT
NULL
no
performance_schema_max_digest_length
performance_schema_max_digest_length
CURRENT_SCHEMA
NULL
OBJECT_SCHEMA
OBJECT_TYPE
NULL
OBJECT_INSTANCE_BEGIN
MYSQL_ERRNO
RETURNED_SQLSTATE
MESSAGE_TEXT
ERRORS
00
WARNINGS
ROWS_AFFECTED
ROWS_SENT
ROWS_EXAMINED
CREATED_TMP_DISK_TABLES
Created_tmp_disk_tables
CREATED_TMP_TABLES
Created_tmp_tables
SELECT_FULL_JOIN
Select_full_join
SELECT_FULL_RANGE_JOIN
Select_full_range_join
SELECT_RANGE
Select_range
SELECT_RANGE_CHECK
Select_range_check
SELECT_SCAN
Select_scan
SORT_MERGE_PASSES
Sort_merge_passes
SORT_RANGE
Sort_range
SORT_ROWS
Sort_rows
SORT_SCAN
Sort_scan
NO_INDEX_USED
NO_GOOD_INDEX_USED
Extra
Range checked for each record
NESTING_EVENT_ID
NESTING_EVENT_LEVEL
OBJECT_TYPE = NULL OBJECT_SCHEMA = NULL OBJECT_NAME = NULL NESTING_EVENT_ID = NULL NESTING_EVENT_TYPE = NULL NESTING_LEVEL = 0
OBJECT_TYPE = the parent statement object type OBJECT_SCHEMA = the parent statement object schema OBJECT_NAME = the parent statement object name NESTING_EVENT_ID = the parent statement EVENT_ID NESTING_EVENT_TYPE = 'STATEMENT' NESTING_LEVEL = the parent statement NESTING_LEVEL plus one
events_statements_current
THREAD_ID
TRUNCATE TABLE
events_statements_current
events_statements_history
N
N
performance_schema_events_statements_history_size
events_statements_history
events_statements_current
TRUNCATE TABLE
events_statements_history
events_statements_history_long
N
N
performance_schema_events_statements_history_long_size
events_statements_history_long
events_statements_current
TRUNCATE TABLE
events_statements_history_long
mysql_stmt_prepare() | COM_STMT_PREPARE |
mysql_stmt_execute() | COM_STMT_EXECUTE |
mysql_stmt_close() | COM_STMT_CLOSE |
PREPARE | SQLCOM_PREPARE |
EXECUTE | SQLCOM_EXECUTE |
DEALLOCATE PREPARE DROP
PREPARE | SQLCOM_DEALLOCATE PREPARE |
prepared_statements_instances
performance_schema_max_prepared_statements_instances
setup_instruments
statement/com/Prepare | COM_STMT_PREPARE |
statement/com/Execute | COM_STMT_EXECUTE |
statement/sql/prepare_sql | SQLCOM_PREPARE |
statement/sql/execute_sql | SQLCOM_EXECUTE |
prepared_statements_instances
COM_STMT_PREPARE
prepared_statements_instances
Performance_schema_prepared_statements_lost
COM_STMT_EXECUTE
prepared_statements_instances
COM_STMT_CLOSE
prepared_statements_instances
prepared_statements_instances
OBJECT_INSTANCE_BEGIN
STATEMENT_ID
STATEMENT_NAME
NULL
PREPARE stmt FROM 'SELECT 1';
SQL_TEXT
?
OWNER_THREAD_ID
OWNER_OBJECT_TYPE
OWNER_OBJECT_NAME
NULL
选择owner_object_type,owner_object_schema,owner_object_name,statement_name,sql_textfrom performance_schema.prepared_statements_instanceswhere owner_object_type不空;
TIMER_PREPARE
COUNT_REPREPARE
COUNT_EXECUTE
MIN_TIMER_EXECUTE
MAX_TIMER_EXECUTE
SUM_
xxx
SUM_
xxx
prepared_statements_instances
OBJECT_INSTANCE_BEGIN
STATEMENT_ID
STATEMENT_NAME
OWNER_THREAD_ID
OWNER_OBJECT_TYPE
OWNER_OBJECT_NAME
events_transactions_current
events_transactions_history
events_transactions_history_long
setup_instruments
setup_consumers
transaction
events_transactions_history
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME = 'transaction';
------------- --------- ------- |名字|启用|定时| ------------- --------- ------- |交易|是|是| ------------- --------- ------- MySQL > SELECT * FROM setup_consumers
WHERE NAME LIKE '%transactions%';
---------------------------------- --------- |名字|启用| ---------------------------------- --------- | events_transactions_current |是| | events_transactions_history |是| | events_transactions_history_long |没有| ---------------------------------- ---------
my.cnf
[mysqld] performance-schema-instrument='transaction=ON' performance-schema-consumer-events-transactions-current=ON performance-schema-consumer-events-transactions-history=ON performance-schema-consumer-events-transactions-history-long=ON
[mysqld] performance-schema-instrument='transaction=OFF' performance-schema-consumer-events-transactions-current=OFF performance-schema-consumer-events-transactions-history=OFF performance-schema-consumer-events-transactions-history-long=OFF
setup_instruments
setup_consumers
UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'transaction'; UPDATE setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%transactions%';
UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'transaction'; UPDATE setup_consumers SET ENABLED = 'NO' WHERE NAME LIKE '%transactions%';
transaction
START TRANSACTION | BEGIN | XA START | XA BEGIN
autocommit
autocommit
COMMIT | ROLLBACK | XA COMMIT | XA ROLLBACK
START
TRANSACTION
BEGIN
XA
START
XA
BEGIN
COMMIT
ROLLBACK
XA
COMMIT
XA
ROLLBACK
START
TRANSACTION
COMMIT
ROLLBACK
START
TRANSACTION
COMMIT
ROLLBACK
START
TRANSACTION
1. SET autocommit = OFF; 2. CREATE TABLE t1 (a INT) ENGINE = InnoDB; 3. START TRANSACTION; -- Transaction 1 START 4. INSERT INTO t1 VALUES (1), (2), (3); 5. CREATE TABLE t2 (a INT) ENGINE = MyISAM; -- Transaction 1 COMMIT -- (implicit; DDL forces commit) 6. INSERT INTO t2 VALUES (1), (2), (3); -- Update nontransactional table 7. UPDATE t2 SET a = a + 1; -- ... and again 8. INSERT INTO t1 VALUES (4), (5), (6); -- Write to transactional table -- Transaction 2 START (implicit) 9. COMMIT; -- Transaction 2 COMMIT
t2
SERIALIZABLE
REPEATABLE READ
autocommit
autocommit
ACCESS_MODE
AUTOCOMMIT
START
TRANSACTION
COMMIT AND
CHAIN
COMMIT
ROLLBACK
SAVEPOINT
ROLLBACK TO
SAVEPOINT
RELEASE
SAVEPOINT
events_transactions_current
MySQL的> SELECT * FROM events_transactions_current LIMIT 1\G
*************************** 1。行*************************** thread_id:26 event_id:7 end_event_id:空event_name:交易状态:活跃的trx_id:空gtid:3e11fa47-71ca-11e1-9e33-c80aa9429562:56 xid:空xa_state:空来源:交易。答:150 timer_start:420833537900000 timer_end:空timer_wait:空access_mode:读写isolation_level:可重复读取自动提交:没有number_of_savepoints:0number_of_rollback_to_savepoint:0 number_of_release_savepoint:0 object_instance_begin:空nesting_event_id:6 nesting_event_type:声明
events_transactions_current
events_transactions_history
events_transactions_history_long
events_transactions_current
THREAD_ID
THREAD_ID
END_EVENT_ID
NULL
EVENT_NAME
NAME
setup_instruments
STATE
ACTIVE
START
TRANSACTION
BEGIN
COMMIT
ROLLBACK
TRX_ID
GTID
gtid_next
AUTOMATIC
gtid_next=AUTOMATIC
gtid_mode
ON_PERMISSIVE
OFF
ANONYMOUS
XID_FORMAT_ID
XID_BQUAL
XA_STATE
ACTIVE
XA
START
XA
END
XA
PREPARE
XA
ROLLBACK
XA
COMMIT
events_transactions_current
events_transactions_current
PREPARED
XA
RECOVER
SOURCE
TIMER_START
TIMER_WAIT
TIMER_START
TIMER_WAIT
TIMER_END
TIMER_END
TIMED = NO
TIMER_END
NULL
ACCESS_MODE
READ
ONLY
ISOLATION_LEVEL
REPEATABLE READ
READ COMMITTED
READ UNCOMMITTED
SERIALIZABLE
AUTOCOMMIT
NUMBER_OF_SAVEPOINTS
NUMBER_OF_RELEASE_SAVEPOINT
SAVEPOINT
ROLLBACK TO
SAVEPOINT
RELEASE
SAVEPOINT
OBJECT_INSTANCE_BEGIN
NESTING_EVENT_ID
EVENT_ID
NESTING_EVENT_TYPE
TRANSACTION
STAGE
TRANSACTION
events_transactions_current
THREAD_ID
events_transactions_history
N
N
performance_schema_events_transactions_history_size
events_transactions_history
events_transactions_current
TRUNCATE TABLE
events_transactions_history
events_transactions_history_long
N
N
performance_schema_events_transactions_history_long_size
events_transactions_history_long
events_transactions_current
TRUNCATE TABLE
events_transactions_history_long
mysql
CURRENT_CONNECTIONS
accounts
HOST
users
hosts
HOST
USER
NULL
user1
hosta
CURRENT_CONNECTIONS
CURRENT_CONNECTIONS
TRUNCATE TABLE
CURRENT_CONNECTIONS
= 0
CURRENT_CONNECTIONS > 0
CURRENT_CONNECTIONS
_summary_by_account
_summary_by_user
MySQL的> SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'performance_schema'
AND TABLE_NAME REGEXP '_summary_by_(account|host|user)'
ORDER BY TABLE_NAME;
------------------------------------------------------ | table_name | ------------------------------------------------------ | events_errors_summary_by_account_by_error | | events_errors_summary_by_host_by_error | | events_errors_summary_by_user_by_error | | events_stages_summary_by_account_by_event_name | | events_stages_summary_by_host_by_event_name | | events_stages_summary_by_user_by_event_name | | events_statements_summary_by_account_by_event_name | | events_statements_summary_by_host_by_event_name | | events_statements_summary_by_user_by_event_name | | events_transactions_summary_by_account_by_event_name | | events_transactions_summary_by_host_by_event_name | | events_transactions_summary_by_user_by_event_name | | events_waits_summary_by_account_by_event_name | | events_waits_summary_by_host_by_event_name | | events_waits_summary_by_user_by_event_name | | memory_summary_by_account_by_event_name | | memory_summary_by_host_by_event_name | | memory_summary_by_user_by_event_name | ------------------------------------------------------
TRUNCATE TABLE
accounts | _summary_by_account
|
hosts | _summary_by_account
_summary_by_thread |
users | _summary_by_account
_summary_by_thread |
_summary_global
events_waits_summary_global_by_event_name
accounts
performance_schema_accounts_size
accounts
TRUNCATE TABLE
USER
NULL
HOST
NULL
CURRENT_CONNECTIONS
TOTAL_CONNECTIONS
accounts
USER
hosts
performance_schema_hosts_size
hosts
TRUNCATE TABLE
HOST
NULL
CURRENT_CONNECTIONS
TOTAL_CONNECTIONS
hosts
HOST
users
performance_schema_users_size
users
TRUNCATE TABLE
USER
NULL
CURRENT_CONNECTIONS
TOTAL_CONNECTIONS
users
USER
mysql_options()
mysql_options4()
session_account_connect_attrs
session_connect_attrs
_
libmysqlclient
_client_name
_client_version
_os
Win64
_pid
_platform
_thread
_client_license
_runtime_vendor
_runtime_version
_client_version
_os
Win64
_pid
_platform
_program_name
_thread
libmysqlclient
mysqlnd
mysqlnd
program_name
program_name
mysqldump
mysqlsh
_client_role
program_name
_client_role
_client_replication_channel_name
FEDERATED
mysqld
federated_storage
libmysqlclient
mysql_options()
CR_INVALID_PARAMETER_NO
Performance_schema_session_connect_attrs_longest_seen
performance_schema_session_connect_attrs_size
Performance_schema_session_connect_attrs_lost
log_error_verbosity
长连接属性 N
是truncated( N
字节丢失)连接 N
,用户 user_name
@ host_name
(如 user_name
),授权:{是} |没有
_truncated
mysql_options()
mysql_options4()
session_account_connect_attrs
session_connect_attrs
session_account_connect_attrs
PROCESSLIST_ID
ATTR_NAME
ATTR_VALUE
ORDINAL_POSITION
session_account_connect_attrs
PROCESSLIST_ID
mysql_options()
mysql_options4()
session_connect_attrs
session_account_connect_attrs
session_connect_attrs
PROCESSLIST_ID
ATTR_NAME
ATTR_VALUE
ORDINAL_POSITION
session_connect_attrs
PROCESSLIST_ID
user_variables_by_thread
user_variables_by_thread
THREAD_ID
VARIABLE_NAME
@
VARIABLE_VALUE
user_variables_by_thread
THREAD_ID
SHOW SLAVE STATUS
SHOW SLAVE STATUS
SELECT
SHOW SLAVE STATUS
Last_SQL_Error
SHOW SLAVE
STATUS
replication_applier_configuration
replication_applier_status
replication_applier_status_by_coordinator
replication_applier_status_by_worker
replication_applier_filters
replication_applier_global_filters
replication_group_members
replication_group_member_stats
replication_connection_status
replication_applier_status_by_coordinator
replication_applier_status_by_worker
SHOW SLAVE STATUS
SHOW SLAVE STATUS
CHANGE MASTER
TO
CHANGE MASTER TO
NULL
OFF
START SLAVE
THREAD_ID
ON
ON
STOP SLAVE
NULL
OFF
STOP
SLAVE
replication_applier_status_by_worker
slave_parallel_workers
START SLAVE
SHOW SLAVE STATUS
SHOW SLAVE STATUS
Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Exec_Master_Log_Pos Until_Condition Until_Log_File Until_Log_Pos
Master_Info_File
server_id
server_uuid
硕士学位_服务器_ idreplicate _不知道_ _ IDS服务器
Skip_Counter
Last_SQL_Errno
Last_Errno Last_Error
LAST_ERROR_NUMBER
replication_applier_status_by_coordinator
replication_applier_status_by_worker
Last_Error
Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table
Slave_IO_State
THREAD_ID
INFORMATION_SCHEMA
PROCESSLIST
Executed_Gtid_Set
gtid_executed
Seconds_Behind_Master
SHOW
STATUS
CHANNEL_NAME
CHANGE MASTER TO
replication_connection_status
replication_connection_configuration
replication_connection_status
replication_connection_configuration
CHANNEL_NAME
HOST
CHANGE MASTER TO
PORT
CHANGE
MASTER TO
USER
CHANGE MASTER TO
NETWORK_INTERFACE
CHANGE MASTER TO
AUTO_POSITION
CHANGE MASTER TO
SSL_ALLOWED
SSL_CA_PATH
SSL_CIPHER
SSL_VERIFY_SERVER_CERTIFICATE
SSL_CRL_PATH
SSL_ALLOWED
Yes
No
Ignored
CHANGE MASTER TO
MASTER_SSL_CAPATH
MASTER_SSL_CIPHER
MASTER_SSL_CRLPATH
MASTER_SSL_VERIFY_SERVER_CERT
CONNECTION_RETRY_INTERVAL
CHANGE MASTER TO
CONNECTION_RETRY_COUNT
CHANGE MASTER TO
HEARTBEAT_INTERVAL
TLS_VERSION
PUBLIC_KEY_PATH
sha256_password
PUBLIC_KEY_PATH
GET_PUBLIC_KEY
caching_sha2_password
PUBLIC_KEY_PATH
replication_connection_configuration
CHANNEL_NAME
TRUNCATE TABLE
replication_connection_configuration
replication_connection_configuration
SHOW SLAVE STATUS
replication_connection_configuration | SHOW SLAVE STATUS |
---|---|
HOST | Master_Host |
PORT | Master_Port |
USER | Master_User |
NETWORK_INTERFACE | Master_Bind |
AUTO_POSITION | Auto_Position |
SSL_ALLOWED | Master_SSL_Allowed |
SSL_CA_FILE | Master_SSL_CA_File |
SSL_CA_PATH | Master_SSL_CA_Path |
SSL_CERTIFICATE | Master_SSL_Cert |
SSL_CIPHER | Master_SSL_Cipher |
SSL_KEY | Master_SSL_Key |
SSL_VERIFY_SERVER_CERTIFICATE | Master_SSL_Verify_Server_Cert |
SSL_CRL_FILE | Master_SSL_Crl |
SSL_CRL_PATH | Master_SSL_Crlpath |
CONNECTION_RETRY_INTERVAL | Connect_Retry |
CONNECTION_RETRY_COUNT | Master_Retry_Count |
TLS_VERSION | Master_TLS_Version |
PUBLIC_KEY_PATH | Master_public_key_path |
GET_PUBLIC_KEY | Get_master_public_key |
replication_connection_configuration
replication_connection_status
replication_connection_configuration
replication_connection_status
CHANNEL_NAME
GROUP_NAME
SOURCE_UUID
server_uuid
THREAD_ID
SERVICE_STATE
ON
CONNECTING
RECEIVED_TRANSACTION_SET
LAST_ERROR_NUMBER
LAST_ERROR_MESSAGE
RESET MASTER
RESET SLAVE
LAST_ERROR_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_HEARTBEAT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
COUNT_RECEIVED_HEARTBEATS
CHANGE MASTER TO
LAST_QUEUED_TRANSACTION
LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_QUEUED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
QUEUEING_TRANSACTION
QUEUEING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
QUEUEING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
QUEUEING_TRANSACTION_START_QUEUE_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
replication_connection_status
CHANNEL_NAME
THREAD_ID
replication_connection_status
SHOW SLAVE STATUS
replication_connection_status | SHOW SLAVE STATUS |
---|---|
SOURCE_UUID | Master_UUID |
THREAD_ID | |
SERVICE_STATE | Slave_IO_Running |
RECEIVED_TRANSACTION_SET | Retrieved_Gtid_Set |
LAST_ERROR_NUMBER | Last_IO_Errno |
LAST_ERROR_MESSAGE | Last_IO_Error |
LAST_ERROR_TIMESTAMP | Last_IO_Error_Timestamp |
CHANGE MASTER TO
replication_applier_configuration
CHANNEL_NAME
DESIRED_DELAY
CHANGE MASTER TO
replication_applier_configuration
CHANNEL_NAME
TRUNCATE TABLE
replication_applier_configuration
replication_applier_configuration
SHOW SLAVE
STATUS
replication_applier_configuration | SHOW SLAVE STATUS |
---|---|
DESIRED_DELAY | SQL_Delay |
replication_applier_status_by_coordinator
replication_applier_status_by_worker
replication_applier_status
CHANNEL_NAME
SERVICE_STATE
ON
REMAINING_DELAY
DESIRED_DELAY
DESIRED_DELAY
replication_applier_configuration
COUNT_TRANSACTIONS_RETRIES
slave_transaction_retries
replication_applier_status
CHANNEL_NAME
TRUNCATE TABLE
replication_applier_status
replication_applier_status
SHOW SLAVE STATUS
replication_applier_status | SHOW SLAVE STATUS |
---|---|
SERVICE_STATE | |
REMAINING_DELAY | SQL_Remaining_Delay |
replication_applier_status_by_worker
replication_applier_status_by_coordinator
CHANNEL_NAME
THREAD_ID
SERVICE_STATE
ON
LAST_ERROR_NUMBER
LAST_ERROR_MESSAGE
RESET MASTER
RESET SLAVE
LAST_ERROR_NUMBER
LAST_ERROR_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_PROCESSED_TRANSACTION
LAST_PROCESSED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_PROCESSED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_PROCESSED_TRANSACTION_START_BUFFER_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_PROCESSED_TRANSACTION_END_BUFFER_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
PROCESSING_TRANSACTION
PROCESSING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
PROCESSING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
PROCESSING_TRANSACTION_START_BUFFER_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
replication_applier_status_by_coordinator
CHANNEL_NAME
THREAD_ID
replication_applier_status_by_coordinator
SHOW SLAVE STATUS
replication_applier_status_by_coordinator | SHOW SLAVE STATUS |
---|---|
THREAD_ID | |
SERVICE_STATE | Slave_SQL_Running |
LAST_ERROR_NUMBER | Last_SQL_Errno |
LAST_ERROR_MESSAGE | Last_SQL_Error |
LAST_ERROR_TIMESTAMP | Last_SQL_Error_Timestamp |
replication_applier_status_by_coordinator
replication_applier_status_by_worker
CHANNEL_NAME
WORKER_ID
id
STOP SLAVE
NULL
THREAD_ID
SERVICE_STATE
ON
LAST_ERROR_NUMBER
LAST_ERROR_MESSAGE
RESET MASTER
RESET SLAVE
LAST_ERROR_NUMBER
LAST_ERROR_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_APPLIED_TRANSACTION
LAST_APPLIED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_APPLIED_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_APPLIED_TRANSACTION_START_APPLY_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
LAST_APPLIED_TRANSACTION_END_APPLY_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
APPLYING_TRANSACTION
APPLYING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
APPLYING_TRANSACTION_IMMEDIATE_COMMIT_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
APPLYING_TRANSACTION_START_APPLY_TIMESTAMP
'YYYY-MM-DD
HH:MM:SS[.fraction]'
replication_applier_status_by_worker
CHANNEL_NAME
THREAD_ID
replication_applier_status_by_worker
SHOW SLAVE STATUS
replication_applier_status_by_worker | SHOW SLAVE STATUS |
---|---|
WORKER_ID | |
THREAD_ID | |
SERVICE_STATE | |
LAST_ERROR_NUMBER | Last_SQL_Errno |
LAST_ERROR_MESSAGE | Last_SQL_Error |
LAST_ERROR_TIMESTAMP | Last_SQL_Error_Timestamp |
replication_applier_global_filters
FILTER_NAME
FILTER_RULE
--replicate-*
CHANGE REPLICATION FILTER
CONFIGURED_BY
CHANGE_REPLICATION_FILTER
CHANGE REPLICATION
FILTER
STARTUP_OPTIONS
ACTIVE_SINCE
replication_applier_filters
CHANNEL_NAME
FILTER_NAME
FILTER_RULE
--replicate-*
CHANGE REPLICATION FILTER
CONFIGURED_BY
CHANGE_REPLICATION_FILTER
CHANGE REPLICATION
FILTER
STARTUP_OPTIONS
CHANGE_REPLICATION_FILTER_FOR_CHANNEL
STARTUP_OPTIONS_FOR_CHANNEL
ACTIVE_SINCE
COUNTER
group_replication_local_address
replication_group_members
replication_group_members
replication_group_member_stats
CHANNEL_NAME
VIEW_ID
MEMBER_ID
COUNT_TRANSACTIONS_IN_QUEUE
COUNT_TRANSACTIONS_CHECKED
COUNT_CONFLICTS_DETECTED
COUNT_TRANSACTIONS_VALIDATING
TRANSACTIONS_COMMITTED_ALL_MEMBERS
LAST_CONFLICT_FREE_TRANSACTION
COUNT_TRANSACTIONS_REMOTE_IN_APPLIER_QUEUE
COUNT_TRANSACTIONS_REMOTE_APPLIED
COUNT_TRANSACTIONS_LOCAL_PROPOSED
COUNT_TRANSACTIONS_LOCAL_ROLLBACK
replication_group_member_stats
data_locks
data_lock_waits
metadata_locks
table_handles
data_locks
mysql> SELECT * FROM data_locks\G
*************************** 1. row ***************************
ENGINE: INNODB
ENGINE_LOCK_ID: 4140:74
ENGINE_TRANSACTION_ID: 4140
THREAD_ID: 37
EVENT_ID: 9
OBJECT_SCHEMA: test
OBJECT_NAME: t1
PARTITION_NAME: NULL
SUBPARTITION_NAME: NULL
INDEX_NAME: NULL
OBJECT_INSTANCE_BEGIN: 140489308280888
LOCK_TYPE: TABLE
LOCK_MODE: IX
LOCK_STATUS: GRANTED
LOCK_DATA: NULL
*************************** 2. row ***************************
ENGINE: INNODB
ENGINE_LOCK_ID: 4140:66:5:1
ENGINE_TRANSACTION_ID: 4140
THREAD_ID: 37
EVENT_ID: 9
OBJECT_SCHEMA: test
OBJECT_NAME: t1
PARTITION_NAME: NULL
SUBPARTITION_NAME: NULL
INDEX_NAME: GEN_CLUST_INDEX
OBJECT_INSTANCE_BEGIN: 140489320307736
LOCK_TYPE: RECORD
LOCK_MODE: X
LOCK_STATUS: GRANTED
LOCK_DATA: supremum pseudo-record
data_locks
data_locks
ENGINE
ENGINE_LOCK_ID
ENGINE_LOCK_ID
ENGINE_TRANSACTION_ID
InnoDB
INFORMATION_SCHEMA
INNODB_TRX
THREAD_ID
THREAD_ID
threads
EVENT_ID
THREAD_ID
events_waits_
xxx
events_stages_
xxx
events_statements_
xxx
events_transactions_
xxx
THREAD_ID
OBJECT_SCHEMA
OBJECT_NAME
PARTITION_NAME
NULL
SUBPARTITION_NAME
NULL
INDEX_NAME
NULL
InnoDB
INDEX_NAME
InnoDB
OBJECT_INSTANCE_BEGIN
LOCK_TYPE
InnoDB
TABLE
LOCK_MODE
InnoDB
X
IX
REC_NOT_GAP
AUTO_INC
PRDT_PAGE
GAP
PREDICATE
InnoDB
LOCK_STATUS
InnoDB
PENDING
LOCK_DATA
InnoDB
RECORD
LOCK_DATA
LOCK_DATA
InnoDB
NULL
data_locks
ENGINE_LOCK_ID
ENGINE_TRANSACTION_ID
THREAD_ID
OBJECT_SCHEMA
PARTITION_NAME
TRUNCATE TABLE
data_locks
data_lock_waits
data_locks
data_locks
data_locks
data_lock_waits
mysql> SELECT * FROM data_lock_waits\G
*************************** 1. row ***************************
ENGINE: INNODB
REQUESTING_ENGINE_LOCK_ID: 4141:66:5:2
REQUESTING_ENGINE_TRANSACTION_ID: 4141
REQUESTING_THREAD_ID: 38
REQUESTING_EVENT_ID: 11
REQUESTING_OBJECT_INSTANCE_BEGIN: 140489320441368
BLOCKING_ENGINE_LOCK_ID: 4140:66:5:2
BLOCKING_ENGINE_TRANSACTION_ID: 4140
BLOCKING_THREAD_ID: 37
BLOCKING_EVENT_ID: 9
BLOCKING_OBJECT_INSTANCE_BEGIN: 140489320307736
data_lock_waits
data_lock_waits
data_locks
data_lock_waits
ENGINE
REQUESTING_ENGINE_LOCK_ID
ENGINE_LOCK_ID
data_locks
REQUESTING_ENGINE_TRANSACTION_ID
REQUESTING_THREAD_ID
REQUESTING_EVENT_ID
REQUESTING_OBJECT_INSTANCE_BEGIN
BLOCKING_ENGINE_LOCK_ID
ENGINE_LOCK_ID
data_locks
BLOCKING_ENGINE_TRANSACTION_ID
BLOCKING_THREAD_ID
BLOCKING_EVENT_ID
BLOCKING_OBJECT_INSTANCE_BEGIN
data_lock_waits
REQUESTING_ENGINE_LOCK_ID
BLOCKING_ENGINE_LOCK_ID
REQUESTING_ENGINE_TRANSACTION_ID
BLOCKING_ENGINE_TRANSACTION_ID
REQUESTING_THREAD_ID
BLOCKING_THREAD_ID
metadata_locks
metadata_locks
performance_schema_max_metadata_locks
wait/lock/metadata/sql/mdl
my.cnf
[mysqld] performance-schema-instrument='wait/lock/metadata/sql/mdl=ON'
[mysqld] performance-schema-instrument='wait/lock/metadata/sql/mdl=OFF'
setup_instruments
UPDATE setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME = 'wait/lock/metadata/sql/mdl';
UPDATE setup_instruments SET ENABLED = 'NO', TIMED = 'NO' WHERE NAME = 'wait/lock/metadata/sql/mdl';
metadata_locks
GRANTED
PENDING
GRANTED
ER_LOCK_DEADLOCK
VICTIM
ER_LOCK_WAIT_TIMEOUT
TIMEOUT
GRANTED
KILLED
VICTIM
KILLED
PRE_ACQUIRE_NOTIFY
metadata_locks
OBJECT_TYPE
GLOBAL
TABLE
PROCEDURE
EVENT
USER LEVEL LOCK
LOCKING
SERVICE
USER LEVEL LOCK
GET_LOCK()
OBJECT_SCHEMA
OBJECT_NAME
OBJECT_INSTANCE_BEGIN
LOCK_TYPE
INTENTION_EXCLUSIVE
SHARED_HIGH_PRIO
SHARED_WRITE
SHARED_NO_WRITE
EXCLUSIVE
LOCK_DURATION
STATEMENT
EXPLICIT
TRANSACTION
FLUSH TABLES WITH READ
LOCK
LOCK_STATUS
PENDING
VICTIM
KILLED
POST_RELEASE_NOTIFY
SOURCE
OWNER_THREAD_ID
OWNER_EVENT_ID
metadata_locks
OBJECT_INSTANCE_BEGIN
OBJECT_TYPE
OBJECT_NAME
OWNER_THREAD_ID
table_handles
table_handles
table_handles
performance_schema_max_table_handles
table_handles
OBJECT_TYPE
OBJECT_SCHEMA
OBJECT_NAME
OBJECT_INSTANCE_BEGIN
OWNER_THREAD_ID
OWNER_EVENT_ID
INTERNAL_LOCK
READ
READ HIGH PRIORITY
WRITE ALLOW
WRITE
WRITE LOW PRIORITY
include/thr_lock.h
EXTERNAL_LOCK
READ EXTERNAL
table_handles
OBJECT_INSTANCE_BEGIN
OBJECT_TYPE
OBJECT_NAME
OWNER_THREAD_ID
global_variables
session_variables
variables_by_thread
persisted_variables
variables_info
session_variables
variables_by_thread
TRUNCATE TABLE
global_variables
session_variables
VARIABLE_NAME
VARIABLE_VALUE
global_variables
session_variables
global_variables
session_variables
VARIABLE_NAME
variables_by_thread
THREAD_ID
VARIABLE_NAME
VARIABLE_VALUE
THREAD_ID
variables_by_thread
THREAD_ID
variables_by_thread
Performance_schema_thread_instances_lost
persisted_variables
SELECT
SET
PERSIST
mysqld-auto.cnf
{“版本”:一、“mysql_server”:{“max_connections”:{“价值”:“千”、“元数据”:{“时间戳”:1.519921706e 15,“用户”:“根”、“主机”:“localhost”} },“自动提交”:{“价值”:“上”、“元数据”:{“时间戳”:1.519921707e 15,“用户”:“根”、“主机”:“localhost”} } } }
persisted_variables
MySQL的> SELECT * FROM persisted_variables;
----------------- ---------------- | variable_name | variable_value | ----------------- ---------------- |自动提交|在| | max_connections | 1000 | ----------------- ----------------
persisted_variables
VARIABLE_NAME
mysqld-auto.cnf
VARIABLE_VALUE
mysqld-auto.cnf
persisted_variables
VARIABLE_NAME
variables_info
variables_info
VARIABLE_NAME
VARIABLE_SOURCE
COMMAND_LINE
COMPILED
COMPILED
DYNAMIC
--init-file
EXPLICIT
--defaults-file
EXTRA
--defaults-extra-file
GLOBAL
EXPLICIT
LOGIN
SERVER
LOGIN
~/.mylogin.cnf
PERSISTED
mysqld-auto.cnf
persisted_globals_load
SERVER
$MYSQL_HOME
/my.cnf
USER
~/.my.cnf
VARIABLE_PATH
VARIABLE_PATH
MIN_VALUE
SET_TIME
SET_USER
user17
'user17'@'%.example.com
SET_HOST
host34.example.com
variables_info
TRUNCATE TABLE
variables_info
VARIABLE_SOURCE
VARIABLE_SOURCE
VARIABLE_PATH
debug_sync
COMPILED
VARIABLE_SOURCE
variables_info
GLOBAL
variables_info
mysql>SELECT VARIABLE_NAME FROM variables_info
WHERE VARIABLE_SOURCE = 'COMMAND_LINE'
ORDER BY VARIABLE_NAME;
+---------------+ | VARIABLE_NAME | +---------------+ | basedir | | datadir | | log_error | | pid_file | | plugin_dir | | port | +---------------+
mysql>SELECT VARIABLE_NAME FROM variables_info
WHERE VARIABLE_SOURCE = 'PERSISTED'
ORDER BY VARIABLE_NAME;
+--------------------------+ | VARIABLE_NAME | +--------------------------+ | event_scheduler | | max_connections | | validate_password.policy | +--------------------------+
variables_info
global_variables
MySQL的> SELECT
VI.VARIABLE_NAME, GV.VARIABLE_VALUE,
VI.MIN_VALUE,VI.MAX_VALUE
FROM variables_info AS VI
INNER JOIN global_variables AS GV
USING(VARIABLE_NAME)
WHERE VI.VARIABLE_SOURCE = 'PERSISTED'
ORDER BY VARIABLE_NAME;
-------------------------- ----------------月亮变| _ name变量值| _ |最大值最小值| _ _ | -------------------------- ----------------月亮_ |事件调度器|我们| 0 0 | _ | |最大连接| 1 200 | | 100000 | |验证_ password.policy | 0 0强| | |月亮-------------------------- ----------------
global_status
session_status
status_by_thread
session_status
status_by_thread
INSTRUMENTED
threads
Com_
xxx
events_statements_summary_global_by_event_name
events_statements_summary_by_thread_by_event_name
选择event_name,count_starfrom events_statements_summary_global_by_event_namewhere event_name喜欢声明/ SQL / %;
global_status
session_status
VARIABLE_NAME
VARIABLE_VALUE
global_status
session_status
global_status
session_status
VARIABLE_NAME
status_by_thread
THREAD_ID
VARIABLE_NAME
VARIABLE_VALUE
THREAD_ID
status_by_thread
THREAD_ID
status_by_thread
performance_schema_max_thread_instances
TRUNCATE
TABLE
global_status
session_status
status_by_thread
performance_schema_accounts_size
performance_schema_hosts_size
performance_schema_users_size
FLUSH STATUS
events_waits_summary_by_account_by_event_name
events_waits_summary_by_host_by_event_name
events_waits_summary_by_instance
events_waits_summary_by_thread_by_event_name
events_waits_summary_by_user_by_event_name
events_stages_summary_by_account_by_event_name
events_stages_summary_by_host_by_event_name
events_stages_summary_by_thread_by_event_name
events_stages_summary_by_user_by_event_name
events_statements_histogram_by_digest
events_statements_histogram_global
events_statements_summary_by_account_by_event_name
events_statements_summary_by_digest
events_statements_summary_by_host_by_event_name
events_statements_summary_by_program
events_statements_summary_by_thread_by_event_name
events_statements_summary_by_user_by_event_name
prepared_statements_instances
events_transactions_summary_by_account_by_event_name
events_transactions_summary_by_host_by_event_name
events_transactions_summary_by_thread_by_event_name
events_transactions_summary_by_user_by_event_name
file_summary_by_event_name
file_summary_by_instance
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_table
socket_summary_by_instance
socket_summary_by_event_name
memory_summary_by_account_by_event_name
memory_summary_by_host_by_event_name
memory_summary_by_thread_by_event_name
memory_summary_by_user_by_event_name
memory_summary_global_by_event_name
events_errors_summary_by_host_by_error
events_errors_summary_by_thread_by_error
events_errors_summary_by_user_by_error
status_by_account
status_by_host
status_by_user
TRUNCATE TABLE
mysql> SELECT * FROM events_waits_summary_global_by_event_name\G
...
*************************** 6. row ***************************
EVENT_NAME: wait/synch/mutex/sql/BINARY_LOG::LOCK_index
COUNT_STAR: 8
SUM_TIMER_WAIT: 2119302
MIN_TIMER_WAIT: 196092
AVG_TIMER_WAIT: 264912
MAX_TIMER_WAIT: 569421
...
*************************** 9. row ***************************
EVENT_NAME: wait/synch/mutex/sql/hash_filo::lock
COUNT_STAR: 69
SUM_TIMER_WAIT: 16848828
MIN_TIMER_WAIT: 0
AVG_TIMER_WAIT: 244185
MAX_TIMER_WAIT: 735345
...
setup_instruments
events_waits_summary_by_account_by_event_name
USER
events_waits_summary_by_host_by_event_name
HOST
events_waits_summary_by_instance
OBJECT_INSTANCE_BEGIN
events_waits_summary_by_thread_by_event_name
EVENT_NAME
events_waits_summary_by_user_by_event_name
USER
events_waits_summary_global_by_event_name
COUNT_STAR
SUM_TIMER_WAIT
NULL
xxx
MIN_TIMER_WAIT
AVG_TIMER_WAIT
MAX_TIMER_WAIT
events_waits_summary_by_account_by_event_name
USER
EVENT_NAME
events_waits_summary_by_host_by_event_name
HOST
events_waits_summary_by_instance
OBJECT_INSTANCE_BEGIN
EVENT_NAME
events_waits_summary_by_thread_by_event_name
THREAD_ID
events_waits_summary_by_user_by_event_name
USER
events_waits_summary_global_by_event_name
EVENT_NAME
TRUNCATE TABLE
events_waits_summary_global_by_event_name
mysql> SELECT * FROM events_stages_summary_global_by_event_name\G
...
*************************** 5. row ***************************
EVENT_NAME: stage/sql/checking permissions
COUNT_STAR: 57
SUM_TIMER_WAIT: 26501888880
MIN_TIMER_WAIT: 7317456
AVG_TIMER_WAIT: 464945295
MAX_TIMER_WAIT: 12858936792
...
*************************** 9. row ***************************
EVENT_NAME: stage/sql/closing tables
COUNT_STAR: 37
SUM_TIMER_WAIT: 662606568
MIN_TIMER_WAIT: 1593864
AVG_TIMER_WAIT: 17907891
MAX_TIMER_WAIT: 437977248
...
setup_instruments
events_stages_summary_by_account_by_event_name
USER
events_stages_summary_by_host_by_event_name
HOST
events_stages_summary_by_thread_by_event_name
EVENT_NAME
events_stages_summary_by_user_by_event_name
USER
events_stages_summary_global_by_event_name
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
events_stages_current
events_waits_current
events_stages_summary_by_account_by_event_name
USER
EVENT_NAME
events_stages_summary_by_host_by_event_name
HOST
events_stages_summary_by_thread_by_event_name
THREAD_ID
events_stages_summary_by_user_by_event_name
USER
events_stages_summary_global_by_event_name
EVENT_NAME
TRUNCATE TABLE
events_stages_summary_global_by_event_name
mysql> SELECT * FROM events_statements_summary_global_by_event_name\G
*************************** 1. row ***************************
EVENT_NAME: statement/sql/select
COUNT_STAR: 25
SUM_TIMER_WAIT: 1535983999000
MIN_TIMER_WAIT: 209823000
AVG_TIMER_WAIT: 61439359000
MAX_TIMER_WAIT: 1363397650000
SUM_LOCK_TIME: 20186000000
SUM_ERRORS: 0
SUM_WARNINGS: 0
SUM_ROWS_AFFECTED: 0
SUM_ROWS_SENT: 388
SUM_ROWS_EXAMINED: 370
SUM_CREATED_TMP_DISK_TABLES: 0
SUM_CREATED_TMP_TABLES: 0
SUM_SELECT_FULL_JOIN: 0
SUM_SELECT_FULL_RANGE_JOIN: 0
SUM_SELECT_RANGE: 0
SUM_SELECT_RANGE_CHECK: 0
SUM_SELECT_SCAN: 6
SUM_SORT_MERGE_PASSES: 0
SUM_SORT_RANGE: 0
SUM_SORT_ROWS: 0
SUM_SORT_SCAN: 0
SUM_NO_INDEX_USED: 6
SUM_NO_GOOD_INDEX_USED: 0
...
setup_instruments
events_statements_summary_by_account_by_event_name
USER
events_statements_summary_by_digest
DIGEST
QUERY_SAMPLE_TEXT
QUERY_SAMPLE_TIMER_WAIT
performance_schema_digests_size
events_statements_summary_by_host_by_event_name
HOST
events_statements_summary_by_program
OBJECT_SCHEMA
events_statements_summary_by_thread_by_event_name
EVENT_NAME
events_statements_summary_by_user_by_event_name
USER
events_statements_summary_global_by_event_name
prepared_statements_instances
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
events_statements_current
events_waits_current
prepared_statements_instances
SUM_
xxx
xxx
events_statements_current
SUM_ERRORS
ERRORS
events_statements_current
events_statements_summary_by_digest
FIRST_SEEN
QUANTILE_95
QUANTILE_99
QUANTILE_999
events_statements_summary_by_digest
QUERY_SAMPLE_TEXT
EXPLAIN
QUERY_SAMPLE_TEXT
QUERY_SAMPLE_TIMER_WAIT
performance_schema_max_sql_text_length
QUERY_SAMPLE_SEEN
QUERY_SAMPLE_TEXT
QUERY_SAMPLE_TIMER_WAIT
QUERY_SAMPLE_TEXT
events_statements_summary_by_program
COUNT_STATEMENTS
MIN_STATEMENTS_WAIT
MAX_STATEMENTS_WAIT
prepared_statements_instances
COUNT_EXECUTE
MIN_TIMER_EXECUTE
MAX_TIMER_EXECUTE
events_transactions_summary_by_account_by_event_name
USER
EVENT_NAME
events_statements_summary_by_digest
SCHEMA_NAME
events_transactions_summary_by_host_by_event_name
HOST
events_statements_summary_by_program
OBJECT_TYPE
OBJECT_NAME
events_statements_summary_by_thread_by_event_name
THREAD_ID
events_transactions_summary_by_user_by_event_name
USER
events_statements_summary_global_by_event_name
EVENT_NAME
TRUNCATE TABLE
events_statements_summary_global_by_event_name
events_statements_summary_by_digest
events_statements_histogram_by_digest
events_statements_summary_global_by_event_name
events_statements_histogram_global
statements_digest
events_statements_summary_by_digest
events_statements_summary_by_digest
FIRST_SEEN
DIGEST
=FIRST_SEEN
LAST_SEEN
DIGEST
=DIGEST
=
DIGEST
=COUNT_STAR
DIGEST
=COUNT_STAR
=NULL
performance_schema_digests_size
setup_objects
events_statements_summary_by_program
mysql>SELECT * FROM events_statements_histogram_by_digest
WHERE SCHEMA_NAME = 'mydb' AND DIGEST = 'bb3f69453119b2d7b3ae40673a9d4c7c'
AND COUNT_BUCKET > 0 ORDER BY BUCKET_NUMBER\G
*************************** 1. row *************************** SCHEMA_NAME: mydb DIGEST: bb3f69453119b2d7b3ae40673a9d4c7c BUCKET_NUMBER: 42 BUCKET_TIMER_LOW: 66069344 BUCKET_TIMER_HIGH: 69183097 COUNT_BUCKET: 1 COUNT_BUCKET_AND_LOWER: 1 BUCKET_QUANTILE: 0.058824 *************************** 2. row *************************** SCHEMA_NAME: mydb DIGEST: bb3f69453119b2d7b3ae40673a9d4c7c BUCKET_NUMBER: 43 BUCKET_TIMER_LOW: 69183097 BUCKET_TIMER_HIGH: 72443596 COUNT_BUCKET: 1 COUNT_BUCKET_AND_LOWER: 2 BUCKET_QUANTILE: 0.117647 *************************** 3. row *************************** SCHEMA_NAME: mydb DIGEST: bb3f69453119b2d7b3ae40673a9d4c7c BUCKET_NUMBER: 44 BUCKET_TIMER_LOW: 72443596 BUCKET_TIMER_HIGH: 75857757 COUNT_BUCKET: 2 COUNT_BUCKET_AND_LOWER: 4 BUCKET_QUANTILE: 0.235294 *************************** 4. row *************************** SCHEMA_NAME: mydb DIGEST: bb3f69453119b2d7b3ae40673a9d4c7c BUCKET_NUMBER: 45 BUCKET_TIMER_LOW: 75857757 BUCKET_TIMER_HIGH: 79432823 COUNT_BUCKET: 6 COUNT_BUCKET_AND_LOWER: 10 BUCKET_QUANTILE: 0.625000 ...
BUCKET_TIMER_HIGH: 75857757 BUCKET_QUANTILE: 0.235294
BUCKET_TIMER_HIGH: 79432823 BUCKET_QUANTILE: 0.625000
events_statements_histogram_by_digest
DIGEST
SCHEMA_NAME
events_statements_summary_by_digest
events_statements_histogram_by_digest
DIGEST
BUCKET_NUMBER
events_statements_histogram_global
BUCKET_NUMBER
N
BUCKET_TIMER_LOW
BUCKET_TIMER_LOW
BUCKET_TIMER_LOW
= 0) is 0.
BUCKET_TIMER_LOW
=k
BUCKET_NUMBER
=k
COUNT_BUCKET
BUCKET_TIMER_LOW
COUNT_BUCKET_AND_LOWER
BUCKET_TIMER_HIGH
BUCKET_QUANTILE
COUNT_BUCKET_AND_LOWER /
SUM(COUNT_BUCKET)
events_statements_histogram_by_digest
SCHEMA_NAME
BUCKET_NUMBER
events_statements_histogram_global
BUCKET_NUMBER
TRUNCATE TABLE
COUNT_BUCKET_AND_LOWER
events_statements_summary_by_digest
events_statements_histogram_by_digest
events_statements_summary_global_by_event_name
events_statements_histogram_global
mysql> SELECT * FROM events_transactions_summary_global_by_event_name LIMIT 1\G
*************************** 1. row ***************************
EVENT_NAME: transaction
COUNT_STAR: 5
SUM_TIMER_WAIT: 19550092000
MIN_TIMER_WAIT: 2954148000
AVG_TIMER_WAIT: 3910018000
MAX_TIMER_WAIT: 5486275000
COUNT_READ_WRITE: 5
SUM_TIMER_READ_WRITE: 19550092000
MIN_TIMER_READ_WRITE: 2954148000
AVG_TIMER_READ_WRITE: 3910018000
MAX_TIMER_READ_WRITE: 5486275000
COUNT_READ_ONLY: 0
SUM_TIMER_READ_ONLY: 0
MIN_TIMER_READ_ONLY: 0
AVG_TIMER_READ_ONLY: 0
MAX_TIMER_READ_ONLY: 0
setup_instruments
events_transactions_summary_by_account_by_event_name
HOST
events_transactions_summary_by_host_by_event_name
EVENT_NAME
events_transactions_summary_by_thread_by_event_name
EVENT_NAME
events_transactions_summary_by_user_by_event_name
EVENT_NAME
events_transactions_summary_global_by_event_name
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
events_transactions_current
events_waits_current
COUNT_READ_WRITE
MIN_TIMER_READ_WRITE
MAX_TIMER_READ_WRITE
COUNT_STAR
xxx
COUNT_READ_ONLY
MIN_TIMER_READ_ONLY
MAX_TIMER_READ_ONLY
COUNT_STAR
xxx
events_transactions_summary_by_account_by_event_name
USER
EVENT_NAME
events_transactions_summary_by_host_by_event_name
HOST
events_transactions_summary_by_thread_by_event_name
THREAD_ID
events_transactions_summary_by_user_by_event_name
USER
events_transactions_summary_global_by_event_name
EVENT_NAME
TRUNCATE TABLE
events_transactions_summary_global_by_event_name
objects_summary_global_by_type
mysql> SELECT * FROM objects_summary_global_by_type\G
...
*************************** 3. row ***************************
OBJECT_TYPE: TABLE
OBJECT_SCHEMA: test
OBJECT_NAME: t
COUNT_STAR: 3
SUM_TIMER_WAIT: 263126976
MIN_TIMER_WAIT: 1522272
AVG_TIMER_WAIT: 87708678
MAX_TIMER_WAIT: 258428280
...
*************************** 10. row ***************************
OBJECT_TYPE: TABLE
OBJECT_SCHEMA: mysql
OBJECT_NAME: user
COUNT_STAR: 14
SUM_TIMER_WAIT: 365567592
MIN_TIMER_WAIT: 1141704
AVG_TIMER_WAIT: 26111769
MAX_TIMER_WAIT: 334783032
...
objects_summary_global_by_type
OBJECT_SCHEMA
objects_summary_global_by_type
xxx
objects_summary_global_by_type
OBJECT_TYPE
OBJECT_NAME
TRUNCATE TABLE
mysql>SELECT * FROM file_summary_by_event_name\G
... *************************** 2. row *************************** EVENT_NAME: wait/io/file/sql/binlog COUNT_STAR: 31 SUM_TIMER_WAIT: 8243784888 MIN_TIMER_WAIT: 0 AVG_TIMER_WAIT: 265928484 MAX_TIMER_WAIT: 6490658832 ... mysql>SELECT * FROM file_summary_by_instance\G
... *************************** 2. row *************************** FILE_NAME: /var/mysql/share/english/errmsg.sys EVENT_NAME: wait/io/file/sql/ERRMSG EVENT_NAME: wait/io/file/sql/ERRMSG OBJECT_INSTANCE_BEGIN: 4686193384 COUNT_STAR: 5 SUM_TIMER_WAIT: 13990154448 MIN_TIMER_WAIT: 26349624 AVG_TIMER_WAIT: 2798030607 MAX_TIMER_WAIT: 8150662536 ...
setup_instruments
file_summary_by_event_name
file_summary_by_instance
EVENT_NAME
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
COUNT_READ
MIN_TIMER_READ
MAX_TIMER_READ
FGETS
FREAD
COUNT_WRITE
MIN_TIMER_WRITE
MAX_TIMER_WRITE
FPUTS
FPRINTF
FWRITE
COUNT_MISC
MIN_TIMER_MISC
MAX_TIMER_MISC
CREATE
OPEN
STREAM_OPEN
SEEK
FLUSH
FSTAT
RENAME
EVENT_NAME
OBJECT_INSTANCE_BEGIN
FILE_NAME
EVENT_NAME
TRUNCATE TABLE
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_table
table_io_waits_summary_by_table
table_io_waits_summary_by_table
OBJECT_SCHEMA
events_waits_current
table_io_waits_summary_by_table
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
xxx
_READxxx
COUNT_READ
MIN_TIMER_READ
MAX_TIMER_READ
xxx
_FETCH
COUNT_WRITE
MIN_TIMER_WRITE
MAX_TIMER_WRITE
xxx
_INSERTxxx
xxx
COUNT_FETCH
MIN_TIMER_FETCH
MAX_TIMER_FETCH
COUNT_INSERT
MIN_TIMER_INSERT
MAX_TIMER_INSERT
COUNT_UPDATE
MIN_TIMER_UPDATE
MAX_TIMER_UPDATE
COUNT_DELETE
MIN_TIMER_DELETE
MAX_TIMER_DELETE
table_io_waits_summary_by_table
OBJECT_TYPE
OBJECT_NAME
TRUNCATE TABLE
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_index_usage
table_io_waits_summary_by_table
PRIMARY
NULL
INDEX_NAME =
NULL
table_io_waits_summary_by_index_usage
OBJECT_TYPE
OBJECT_NAME
TRUNCATE TABLE
table_io_waits_summary_by_table
table_lock_waits_summary_by_table
thr_lock()
read normal read with shared locks read high priority read no insert write allow write write concurrent insert write delayed write low priority write normal
handler::external_lock()
read external write external
table_lock_waits_summary_by_table
OBJECT_SCHEMA
events_waits_current
table_lock_waits_summary_by_table
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
xxx
_READxxx
COUNT_READ
MIN_TIMER_READ
MAX_TIMER_READ
xxx
_READ_NORMALxxx
xxx
xxx
COUNT_WRITE
MIN_TIMER_WRITE
MAX_TIMER_WRITE
xxx
_WRITE_ALLOW_WRITExxx
xxx
xxx
COUNT_READ_NORMAL
MIN_TIMER_READ_NORMAL
MAX_TIMER_READ_NORMAL
COUNT_READ_WITH_SHARED_LOCKS
MIN_TIMER_READ_WITH_SHARED_LOCKS
MAX_TIMER_READ_WITH_SHARED_LOCKS
COUNT_READ_HIGH_PRIORITY
MIN_TIMER_READ_HIGH_PRIORITY
MAX_TIMER_READ_HIGH_PRIORITY
COUNT_READ_NO_INSERT
MIN_TIMER_READ_NO_INSERT
MAX_TIMER_READ_NO_INSERT
COUNT_READ_EXTERNAL
MIN_TIMER_READ_EXTERNAL
MAX_TIMER_READ_EXTERNAL
COUNT_WRITE_ALLOW_WRITE
MIN_TIMER_WRITE_ALLOW_WRITE
MAX_TIMER_WRITE_ALLOW_WRITE
COUNT_WRITE_CONCURRENT_INSERT
MIN_TIMER_WRITE_CONCURRENT_INSERT
MAX_TIMER_WRITE_CONCURRENT_INSERT
COUNT_WRITE_LOW_PRIORITY
MIN_TIMER_WRITE_LOW_PRIORITY
MAX_TIMER_WRITE_LOW_PRIORITY
COUNT_WRITE_NORMAL
MIN_TIMER_WRITE_NORMAL
MAX_TIMER_WRITE_NORMAL
COUNT_WRITE_EXTERNAL
MIN_TIMER_WRITE_EXTERNAL
MAX_TIMER_WRITE_EXTERNAL
table_lock_waits_summary_by_table
OBJECT_TYPE
OBJECT_NAME
TRUNCATE TABLE
socket_summary_by_event_name
socket_summary_by_instance
socket_summary_by_instance
idle
setup_instruments
socket_summary_by_event_name
socket_summary_by_instance
COUNT_STAR
MIN_TIMER_WAIT
MAX_TIMER_WAIT
COUNT_READ
MIN_TIMER_READ
MAX_TIMER_READ
RECV
RECVMSG
COUNT_WRITE
MIN_TIMER_WRITE
MAX_TIMER_WRITE
SEND
SENDMSG
COUNT_MISC
MIN_TIMER_MISC
MAX_TIMER_MISC
CONNECT
ACCEPT
SHUTDOWN
socket_summary_by_instance
client_connection
server_unix_socket
EVENT_NAME
OBJECT_INSTANCE_BEGIN
EVENT_NAME
TRUNCATE TABLE
events_statements_summary_by_digest
mysql>SELECT * FROM memory_summary_global_by_event_name
WHERE EVENT_NAME = 'memory/sql/TABLE'\G
*************************** 1. row *************************** EVENT_NAME: memory/sql/TABLE COUNT_ALLOC: 1381 COUNT_FREE: 924 SUM_NUMBER_OF_BYTES_ALLOC: 2059873 SUM_NUMBER_OF_BYTES_FREE: 1407432 LOW_COUNT_USED: 0 CURRENT_COUNT_USED: 457 HIGH_COUNT_USED: 461 LOW_NUMBER_OF_BYTES_USED: 0 CURRENT_NUMBER_OF_BYTES_USED: 652441 HIGH_NUMBER_OF_BYTES_USED: 669269
setup_instruments
memory_summary_by_account_by_event_name
HOST
memory_summary_by_host_by_event_name
EVENT_NAME
memory_summary_by_thread_by_event_name
EVENT_NAME
memory_summary_by_user_by_event_name
EVENT_NAME
memory_summary_global_by_event_name
COUNT_ALLOC
SUM_NUMBER_OF_BYTES_ALLOC
CURRENT_COUNT_USED
COUNT_ALLOC
CURRENT_NUMBER_OF_BYTES_USED
SUM_NUMBER_OF_BYTES_ALLOC
LOW_COUNT_USED
CURRENT_COUNT_USED
LOW_NUMBER_OF_BYTES_USED
CURRENT_NUMBER_OF_BYTES_USED
memory_summary_by_account_by_event_name
USER
EVENT_NAME
memory_summary_by_host_by_event_name
HOST
memory_summary_by_thread_by_event_name
THREAD_ID
memory_summary_by_user_by_event_name
USER
memory_summary_global_by_event_name
EVENT_NAME
TRUNCATE TABLE
COUNT_ALLOC
SUM_NUMBER_OF_BYTES_ALLOC
LOW_COUNT_USED
CURRENT_COUNT_USED
LOW_NUMBER_OF_BYTES_USED
CURRENT_NUMBER_OF_BYTES_USED
memory_summary_global_by_event_name
setup_instruments
code_area
instrument_name
memory/performance_schema/
memory_summary_global_by_event_name
my.cnf
[mysqld] performance-schema-instrument='memory/%=ON'
[mysqld] performance-schema-instrument='memory/%=OFF'
ENABLED
setup_instruments
UPDATE setup_instruments SET ENABLED = 'YES' WHERE NAME LIKE 'memory/%';
UPDATE setup_instruments SET ENABLED = 'NO' WHERE NAME LIKE 'memory/%';
TIMED
setup_instruments
N
COUNT_ALLOC
CURRENT_COUNT_USED
HIGH_COUNT_USED
SUM_NUMBER_OF_BYTES_ALLOC
N
CURRENT_NUMBER_OF_BYTES_USED
N
HIGH_NUMBER_OF_BYTES_USED
COUNT_FREE
CURRENT_COUNT_USED
LOW_COUNT_USED
SUM_NUMBER_OF_BYTES_FREE
N
CURRENT_NUMBER_OF_BYTES_USED
N
LOW_NUMBER_OF_BYTES_USED
LOW_COUNT_USED
HIGH_COUNT_USED
memory_summary_global_by_event_name
LOW_NUMBER_OF_BYTES_USED
memory_summary_by_thread_by_event_name
LOW_NUMBER_OF_BYTES_USED
HIGH_NUMBER_OF_BYTES_USED
error
ERROR_NUMBER
ERROR_NAME
SQLSTATE
ERROR_NUMBER
ER_TABLE_EXISTS_ERROR
42S01
mysql>SELECT * FROM events_errors_summary_global_by_error
WHERE SUM_ERROR_RAISED <> 0\G
*************************** 1. row *************************** ERROR_NUMBER: 1064 ERROR_NAME: ER_PARSE_ERROR SQL_STATE: 42000 SUM_ERROR_RAISED: 1 SUM_ERROR_HANDLED: 0 FIRST_SEEN: 2016-06-28 07:34:02 LAST_SEEN: 2016-06-28 07:34:02 *************************** 2. row *************************** ERROR_NUMBER: 1146 ERROR_NAME: ER_NO_SUCH_TABLE SQL_STATE: 42S02 SUM_ERROR_RAISED: 2 SUM_ERROR_HANDLED: 0 FIRST_SEEN: 2016-06-28 07:34:05 LAST_SEEN: 2016-06-28 07:36:18 *************************** 3. row *************************** ERROR_NUMBER: 1317 ERROR_NAME: ER_QUERY_INTERRUPTED SQL_STATE: 70100 SUM_ERROR_RAISED: 1 SUM_ERROR_HANDLED: 0 FIRST_SEEN: 2016-06-28 11:01:49 LAST_SEEN: 2016-06-28 11:01:49
events_errors_summary_by_account_by_error
HOST
events_errors_summary_by_host_by_error
ERROR_NUMBER
events_errors_summary_by_thread_by_error
ERROR_NUMBER
events_errors_summary_by_user_by_error
ERROR_NUMBER
events_errors_summary_global_by_error
SUM_ERROR_RAISED
SUM_ERROR_HANDLED
FIRST_SEEN
NULL
M
N
Q
NULL
ERROR_NUMBER=0
ERROR_NAME=NULL
SQLSTATE=NULL
events_errors_summary_by_account_by_error
USER
ERROR_NUMBER
events_errors_summary_by_host_by_error
HOST
events_errors_summary_by_thread_by_error
THREAD_ID
events_errors_summary_by_user_by_error
USER
events_errors_summary_global_by_error
ERROR_NUMBER
TRUNCATE TABLE
NULL
NULL
events_errors_summary_global_by_error
status_by_account
HOST
status_by_host
VARIABLE_NAME
status_by_user
VARIABLE_NAME
VARIABLE_VALUE
USER
VARIABLE_NAME
HOST
USER
mysql
performance_schema_accounts_size
performance_schema_hosts_size
performance_schema_users_size
TRUNCATE
TABLE
status_by_account
status_by_host
status_by_user
FLUSH STATUS
host_cache
performance_timers
threads
user_defined_functions
CREATE
FUNCTION
log_status
host_cache
host_cache
SELECT
host_cache
IP
HOST
NULL
HOST_VALIDATED
HOST_VALIDATED
HOST
NO
SUM_CONNECT_ERRORS
max_connect_errors
HOST_VALIDATED = YES
COUNT_HOST_BLOCKED_ERRORS
SUM_CONNECT_ERRORS
max_connect_errors
COUNT_NAMEINFO_TRANSIENT_ERRORS
COUNT_NAMEINFO_PERMANENT_ERRORS
COUNT_FORMAT_ERRORS
Host
1.2.example.com
COUNT_ADDRINFO_TRANSIENT_ERRORS
COUNT_ADDRINFO_PERMANENT_ERRORS
COUNT_FCRDNS_ERRORS
COUNT_HOST_ACL_ERRORS
ER_HOST_NOT_PRIVILEGED
COUNT_NO_AUTH_PLUGIN_ERRORS
COUNT_AUTH_PLUGIN_ERRORS
COUNT_AUTHENTICATION_ERRORS
COUNT_HANDSHAKE_ERRORS
COUNT_HANDSHAKE_ERRORS
COUNT_PROXY_USER_ERRORS
COUNT_PROXY_USER_ACL_ERRORS
PROXY
COUNT_AUTHENTICATION_ERRORS
COUNT_SSL_ERRORS
COUNT_MAX_USER_CONNECTIONS_ERRORS
COUNT_MAX_USER_CONNECTIONS_PER_HOUR_ERRORS
COUNT_DEFAULT_DATABASE_ERRORS
COUNT_INIT_CONNECT_ERRORS
init_connect
COUNT_LOCAL_ERRORS
COUNT_UNKNOWN_ERRORS
host_cache
FIRST_SEEN
IP
LAST_SEEN
IP
FIRST_ERROR_SEEN
IP
LAST_ERROR_SEEN
IP
host_cache
IP
HOST
FLUSH HOSTS
TRUNCATE TABLE
host_cache
host_cache
FLUSH HOSTS
RELOAD
TRUNCATE TABLE
DROP
host_cache
performance_timers
MySQL的> SELECT * FROM performance_timers;
------------- ----------------- ------------------ ---------------- | timer_name | timer_frequency | timer_resolution | timer_overhead | ------------- ----------------- ------------------ ---------------- |周期| 2389029850 | 1 | 72 | |纳秒| 1000000000 | 1 | 112 | |微秒| 1000000 | 1 | 136 | |毫秒| 1036 | 1 | 168 | ------------- ----------------- ------------------ ----------------
NULL
performance_timers
TIMER_NAME
TIMER_FREQUENCY
CYCLE
TIMER_RESOLUTION
TIMER_OVERHEAD
performance_timers
threads
MySQL的> SELECT * FROM threads\G
*************************** 1。行*************************** thread_id:1名称:螺纹/ SQL /主要类型:背景processlist_id:空processlist_user:空processlist_host:空processlist_db:nullprocesslist_command:空processlist_time:80284 processlist_state:空processlist_info:空parent_thread_id:空的作用:空仪表:是的历史:是的connection_type:空thread_os_id:489803 resource_group:sys_default *************************** 4。行*************************** thread_id:五一名称:螺纹/ SQL / one_connection类型:前景processlist_id:34 processlist_user:伊莎贝拉processlist_host:localhost processlist_db:performance_schemaprocesslist_command:查询processlist_time:0 processlist_state:发送数据processlist_info:SELECT * FROM线程parent_thread_id:1作用:空仪表:是的历史:是的connection_type:SSL / TLS thread_os_id:755399 resource_group:usr_default…
threads
INSTRUMENTED
setup_actors
setup_actors
threads
threads
INSTRUMENTED
setup_actors
HISTORY
threads
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
threads
threads
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
threads
threads
INSTRUMENTED
setup_actors
HISTORY
threads
HISTORY
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
threads
INFORMATION_SCHEMA.PROCESSLIST
SHOW PROCESSLIST
PROCESS
threads
threads
THREAD_ID
NAME
thread/sql/one_connection
main()
TYPE
FOREGROUND
InnoDB
PROCESSLIST_ID
INFORMATION_SCHEMA.PROCESSLIST
Id
SHOW PROCESSLIST
CONNECTION_ID()
PROCESSLIST_ID
PROCESSLIST_USER
NULL
PROCESSLIST_HOST
NULL
HOST
PROCESSLIST
SHOW PROCESSLIST
socket_instances
MySQL的> SELECT NAME, ENABLED, TIMED FROM setup_instruments
WHERE NAME LIKE 'wait/io/socket%';
---------------------------------------- --------- ------- |名字|启用|定时| ---------------------------------------- --------- ------- |等待/ IO /插座/ SQL / server_tcpip_socket |没有|没有| |等待/ IO /插座/ SQL / server_unix_socket |没有|没有| |等待/ IO /插座/ SQL / client_connection |没有|没有| ---------------------------------------- --------- ------- 3行设定(0.01秒)MySQL > UPDATE setup_instruments SET ENABLED='YES' WHERE NAME LIKE 'wait/io/socket%';
查询行,3行受影响(0秒)的行匹配:3改变:3警告:0mysql > SELECT * FROM socket_instances\G
*************************** 1。行*************************** event_name:等待/ IO /插座/ SQL / client_connectionobject_instance_begin:140612577298432:31:53 thread_id socket_id IP::::127.0.0.1端口:55642范围:主动…
PROCESSLIST_DB
NULL
PROCESSLIST_COMMAND
Sleep
COM_
xxx
xxx
NULL
PROCESSLIST_TIME
PROCESSLIST_STATE
PROCESSLIST_STATE
NULL
PROCESSLIST_INFO
NULL
SELECT
SELECT
PARENT_THREAD_ID
THREAD_ID
ROLE
INSTRUMENTED
YES
INSTRUMENTED
setup_actors
PROCESSLIST_HOST
threads
INSTRUMENTED
setup_actors
INSTRUMENTED
thread_instrumentation
setup_consumers
threads.INSTRUMENTED
ENABLED
setup_instruments
HISTORY
YES
HISTORY
setup_actors
PROCESSLIST_HOST
threads
HISTORY
setup_actors
HISTORY
setup_consumers
events_waits_history
events_waits_history_long
events_waits_history_long
threads.HISTORY
ENABLED
setup_instruments
CONNECTION_TYPE
NULL
SSL/TLS
Named Pipe
THREAD_OS_ID
THREAD_OS_ID
THREAD_OS_ID
THREAD_OS_ID
THREAD_OS_ID
proc
[pid]
[tid]
ps(1)
RESOURCE_GROUP
NULL
threads
THREAD_ID
NAME
PROCESSLIST_ID
PROCESSLIST_USER
PROCESSLIST_HOST
THREAD_OS_ID
TRUNCATE TABLE
threads
user_defined_functions
CREATE
FUNCTION
user_defined_functions
UDF_NAME
NULL
CREATE
FUNCTION
UDF_RETURN_TYPE
int
real
row
UDF_TYPE
function
UDF_LIBRARY
NULL
CREATE
FUNCTION
UDF_USAGE_COUNT
user_defined_functions
UDF_NAME
log_status
log_status
log_status
InnoDB
log_status
SERVER_UUID
server_uuid
LOCAL
binary_log_file
binary_log_position
log_status
gtid_executed
gtid_executed
binary_log_file
REPLICATION
channel_name
relay_log_file
relay_log_pos
log_status
STORAGE_ENGINES
log_status
BACKUP_ADMIN
log_status
TRUNCATE TABLE
log_status
--performance-schema-consumer-
consumer_name
=value
setup_consumers
--performance-schema-instrument=
instrument_name
=value
--performance-schema-consumer-events-stages-current=
value
events-stages-current
--performance-schema-consumer-events-stages-history=
value
events-stages-history
--performance-schema-consumer-events-stages-history-long=
value
events-stages-history-long
--performance-schema-consumer-events-statements-current=
value
events-statements-current
--performance-schema-consumer-events-statements-history=
value
events-statements-history
--performance-schema-consumer-events-statements-history-long=
value
events-statements-history-long
--performance-schema-consumer-events-transactions-current=
value
events-transactions-current
--performance-schema-consumer-events-transactions-history=
value
events-transactions-history
--performance-schema-consumer-events-transactions-history-long=
value
events-transactions-history-long
--performance-schema-consumer-events-waits-current=
value
events-waits-current
--performance-schema-consumer-events-waits-history=
value
events-waits-history
--performance-schema-consumer-events-waits-history-long=
value
events-waits-history-long
--performance-schema-consumer-global-instrumentation=
value
global-instrumentation
--performance-schema-consumer-statements-digest=
value
statements-digest
--performance-schema-consumer-thread-instrumentation=
value
thread-instrumentation
mysql> SHOW VARIABLES LIKE 'perf%';
+----------------------------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------------------------+-------+
| performance_schema | ON |
| performance_schema_accounts_size | -1 |
| performance_schema_digests_size | 10000 |
| performance_schema_events_stages_history_long_size | 10000 |
| performance_schema_events_stages_history_size | 10 |
| performance_schema_events_statements_history_long_size | 10000 |
| performance_schema_events_statements_history_size | 10 |
| performance_schema_events_transactions_history_long_size | 10000 |
| performance_schema_events_transactions_history_size | 10 |
| performance_schema_events_waits_history_long_size | 10000 |
| performance_schema_events_waits_history_size | 10 |
| performance_schema_hosts_size | -1 |
| performance_schema_max_cond_classes | 80 |
| performance_schema_max_cond_instances | -1 |
| performance_schema_max_digest_length | 1024 |
| performance_schema_max_file_classes | 50 |
| performance_schema_max_file_handles | 32768 |
| performance_schema_max_file_instances | -1 |
| performance_schema_max_index_stat | -1 |
| performance_schema_max_memory_classes | 320 |
| performance_schema_max_metadata_locks | -1 |
| performance_schema_max_mutex_classes | 220 |
| performance_schema_max_mutex_instances | -1 |
| performance_schema_max_prepared_statements_instances | -1 |
| performance_schema_max_program_instances | -1 |
| performance_schema_max_rwlock_classes | 40 |
| performance_schema_max_rwlock_instances | -1 |
| performance_schema_max_socket_classes | 10 |
| performance_schema_max_socket_instances | -1 |
| performance_schema_max_sql_text_length | 1024 |
| performance_schema_max_stage_classes | 150 |
| performance_schema_max_statement_classes | 192 |
| performance_schema_max_statement_stack | 10 |
| performance_schema_max_table_handles | -1 |
| performance_schema_max_table_instances | -1 |
| performance_schema_max_table_lock_stat | -1 |
| performance_schema_max_thread_classes | 50 |
| performance_schema_max_thread_instances | -1 |
| performance_schema_session_connect_attrs_size | 512 |
| performance_schema_setup_actors_size | -1 |
| performance_schema_setup_objects_size | -1 |
| performance_schema_users_size | -1 |
+----------------------------------------------------------+-------+
--performance-schema=# | |
performance_schema | |
ON |
ON
ON
OFF
global_variables
session_variables
global_status
session_status
SHOW VARIABLES
SHOW STATUS
performance_schema_accounts_size
--performance-schema-accounts-size=# | |
performance_schema_accounts_size | |
-1 | |
-1 | |
1048576 |
accounts
accounts
status_by_account
performance_schema_digests_size
--performance-schema-digests-size=# | |
performance_schema_digests_size | |
-1 | |
-1 | |
1048576 |
events_statements_summary_by_digest
Performance_schema_digest_lost
--performance-schema-error-size | |
performance_schema_error_size | |
number of server error codes | |
0 | |
1048576 |
NULL
ERROR_NUMBER=0
ERROR_NAME=NULL
SQLSTATE=NULL
performance_schema_events_stages_history_long_size
--performance-schema-events-stages-history-long-size=# | |
performance_schema_events_stages_history_long_size | |
-1 |
performance_schema_events_stages_history_size
--performance-schema-events-stages-history-size=# | |
performance_schema_events_stages_history_size | |
-1 |
events_stages_history
performance_schema_events_statements_history_long_size
--performance-schema-events-statements-history-long-size=# | |
performance_schema_events_statements_history_long_size | |
-1 |
performance_schema_events_statements_history_size
--performance-schema-events-statements-history-size=# | |
performance_schema_events_statements_history_size | |
-1 |
events_statements_history
performance_schema_events_transactions_history_long_size
--performance-schema-events-transactions-history-long-size=# | |
performance_schema_events_transactions_history_long_size | |
-1 |
performance_schema_events_transactions_history_size
--performance-schema-events-transactions-history-size=# | |
performance_schema_events_transactions_history_size | |
-1 |
events_transactions_history
performance_schema_events_waits_history_long_size
--performance-schema-events-waits-history-long-size=# | |
performance_schema_events_waits_history_long_size | |
-1 |
performance_schema_events_waits_history_size
--performance-schema-events-waits-history-size=# | |
performance_schema_events_waits_history_size | |
-1 |
events_waits_history
--performance-schema-hosts-size=# | |
performance_schema_hosts_size | |
-1 | |
-1 | |
1048576 |
hosts
hosts
status_by_host
performance_schema_max_cond_classes
--performance-schema-max-cond-classes=# | |
performance_schema_max_cond_classes | |
80 | |
0 | |
1024 | |
256 |
performance_schema_max_cond_instances
--performance-schema-max-cond-instances=# | |
performance_schema_max_cond_instances | |
-1 |
performance_schema_max_digest_length
--performance-schema-max-digest-length=# | |
performance_schema_max_digest_length | |
1024 | |
0 | |
1048576 |
max_digest_length
performance_schema_max_digest_sample_age
--performance-schema-max-digest-sample-age=# | |
performance_schema_max_digest_sample_age | |
60 | |
0 | |
1048576 |
events_statements_summary_by_digest
performance_schema_max_digest_sample_age
performance_schema_max_file_classes
--performance-schema-max-file-classes=# | |
performance_schema_max_file_classes | |
80 | |
0 | |
1024 | |
256 |
performance_schema_max_file_handles
--performance-schema-max-file-handles=# | |
performance_schema_max_file_handles | |
32768 |
performance_schema_max_file_handles
open_files_limit
open_files_limit
performance_schema_max_file_handles
performance_schema_max_file_instances
--performance-schema-max-file-instances=# | |
performance_schema_max_file_instances | |
-1 |
performance_schema_max_index_stat
--performance-schema-max-index-stat=# | |
performance_schema_max_index_stat | |
-1 |
Performance_schema_index_stat_lost
performance_schema_max_table_instances
performance_schema_max_memory_classes
--performance-schema-max-memory-classes=# | |
performance_schema_max_memory_classes | |
450 | |
350 |
performance_schema_max_metadata_locks
--performance-schema-max-metadata-locks=# | |
performance_schema_max_metadata_locks | |
-1 |
metadata_locks
Performance_schema_metadata_lock_lost
performance_schema_max_mutex_classes
--performance-schema-max-mutex-classes=# | |
performance_schema_max_mutex_classes | |
300 | |
250 | |
220 | |
200 | |
0 | |
1024 | |
256 |
performance_schema_max_mutex_instances
--performance-schema-max-mutex-instances=# | |
performance_schema_max_mutex_instances | |
-1 |
performance_schema_max_prepared_statements_instances
--performance-schema-max-prepared-statements-instances=# | |
performance_schema_max_prepared_statements_instances | |
-1 |
prepared_statements_instances
Performance_schema_prepared_statements_lost
max_prepared_stmt_count
performance_schema_max_rwlock_classes
--performance-schema-max-rwlock-classes=# | |
performance_schema_max_rwlock_classes | |
40 | |
0 | |
1024 | |
256 |
performance_schema_max_program_instances
--performance-schema-max-program-instances=# | |
performance_schema_max_program_instances | |
-1 |
Performance_schema_program_lost
performance_schema_max_rwlock_instances
--performance-schema-max-rwlock-instances=# | |
performance_schema_max_rwlock_instances | |
-1 |
performance_schema_max_socket_classes
--performance-schema-max-socket-classes=# | |
performance_schema_max_socket_classes | |
10 | |
0 | |
1024 | |
256 |
performance_schema_max_socket_instances
--performance-schema-max-socket-instances=# | |
performance_schema_max_socket_instances | |
-1 |
performance_schema_max_sql_text_length
--performance-schema-max-sql-text-length=# | |
performance_schema_max_sql_text_length | |
1024 | |
0 | |
1048576 |
SQL_TEXT
events_statements_current
events_statements_history
events_statements_history_long
QUERY_SAMPLE_TEXT
events_statements_summary_by_digest
performance_schema_max_sql_text_length
performance_schema_max_sql_text_length
performance_schema_max_stage_classes
--performance-schema-max-stage-classes=# | |
performance_schema_max_stage_classes | |
150 | |
0 | |
1024 | |
256 |
performance_schema_max_statement_classes
--performance-schema-max-statement-classes=# | |
performance_schema_max_statement_classes | |
-1 |
performance_schema_max_statement_stack
--performance-schema-max-statement-stack=# | |
performance_schema_max_statement_stack | |
10 |
Performance_schema_nested_statement_lost
performance_schema_max_table_handles
--performance-schema-max-table-handles=# | |
performance_schema_max_table_handles | |
-1 |
table_handles
Performance_schema_table_handles_lost
performance_schema_max_table_instances
--performance-schema-max-table-instances=# | |
performance_schema_max_table_instances | |
-1 |
performance_schema_max_table_lock_stat
--performance-schema-max-table-lock-stat=# | |
performance_schema_max_table_lock_stat | |
-1 |
Performance_schema_table_lock_stat_lost
performance_schema_max_thread_classes
--performance-schema-max-thread-classes=# | |
performance_schema_max_thread_classes | |
100 | |
50 | |
0 | |
1024 | |
256 |
performance_schema_max_thread_instances
--performance-schema-max-thread-instances=# | |
performance_schema_max_thread_instances | |
-1 |
threads
Performance_schema_thread_instances_lost
max_connections
performance_schema_max_thread_instances
variables_by_thread
status_by_thread
Performance_schema_thread_instances_lost
performance_schema_session_connect_attrs_size
--performance-schema-session-connect-attrs-size=# | |
performance_schema_session_connect_attrs_size | |
-1 | |
-1 | |
1048576 |
Performance_schema_session_connect_attrs_lost
log_error_verbosity
performance_schema_session_connect_attrs_size
Performance_schema_session_connect_attrs_lost
performance_schema_session_connect_attrs_size
performance_schema_session_connect_attrs_size
performance_schema_setup_actors_size
--performance-schema-setup-actors-size=# | |
performance_schema_setup_actors_size | |
-1 |
setup_actors
performance_schema_setup_objects_size
--performance-schema-setup-objects-size=# | |
performance_schema_setup_objects_size | |
-1 |
setup_objects
--performance-schema-users-size=# | |
performance_schema_users_size | |
-1 | |
-1 | |
1048576 |
users
users
status_by_user
mysql> SHOW STATUS LIKE 'perf%';
+-------------------------------------------+-------+
| Variable_name | Value |
+-------------------------------------------+-------+
| Performance_schema_accounts_lost | 0 |
| Performance_schema_cond_classes_lost | 0 |
| Performance_schema_cond_instances_lost | 0 |
| Performance_schema_file_classes_lost | 0 |
| Performance_schema_file_handles_lost | 0 |
| Performance_schema_file_instances_lost | 0 |
| Performance_schema_hosts_lost | 0 |
| Performance_schema_locker_lost | 0 |
| Performance_schema_mutex_classes_lost | 0 |
| Performance_schema_mutex_instances_lost | 0 |
| Performance_schema_rwlock_classes_lost | 0 |
| Performance_schema_rwlock_instances_lost | 0 |
| Performance_schema_socket_classes_lost | 0 |
| Performance_schema_socket_instances_lost | 0 |
| Performance_schema_stage_classes_lost | 0 |
| Performance_schema_statement_classes_lost | 0 |
| Performance_schema_table_handles_lost | 0 |
| Performance_schema_table_instances_lost | 0 |
| Performance_schema_thread_classes_lost | 0 |
| Performance_schema_thread_instances_lost | 0 |
| Performance_schema_users_lost | 0 |
+-------------------------------------------+-------+
Performance_schema_accounts_lost
accounts
Performance_schema_cond_classes_lost
Performance_schema_cond_instances_lost
Performance_schema_digest_lost
events_statements_summary_by_digest
performance_schema_digests_size
Performance_schema_file_classes_lost
Performance_schema_file_handles_lost
Performance_schema_file_instances_lost
hosts
Performance_schema_index_stat_lost
performance_schema_max_index_stat
Performance_schema_locker_lost
Performance_schema_memory_classes_lost
Performance_schema_metadata_lock_lost
metadata_locks
performance_schema_max_metadata_locks
Performance_schema_mutex_classes_lost
Performance_schema_mutex_instances_lost
Performance_schema_nested_statement_lost
performance_schema_max_statement_stack
Performance_schema_prepared_statements_lost
prepared_statements_instances
performance_schema_max_prepared_statements_instances
Performance_schema_program_lost
performance_schema_max_program_instances
Performance_schema_rwlock_classes_lost
Performance_schema_rwlock_instances_lost
Performance_schema_session_connect_attrs_longest_seen
performance_schema_session_connect_attrs_size
Performance_schema_session_connect_attrs_longest_seen
performance_schema_session_connect_attrs_size
Performance_schema_session_connect_attrs_lost
performance_schema_session_connect_attrs_size
Performance_schema_session_connect_attrs_lost
performance_schema_session_connect_attrs_size
Performance_schema_socket_classes_lost
Performance_schema_socket_instances_lost
Performance_schema_stage_classes_lost
Performance_schema_statement_classes_lost
Performance_schema_table_handles_lost
performance_schema_max_table_handles
Performance_schema_table_instances_lost
Performance_schema_table_lock_stat_lost
performance_schema_max_table_lock_stat
Performance_schema_thread_classes_lost
Performance_schema_thread_instances_lost
threads
performance_schema_max_thread_instances
users
performance_schema_accounts_size performance_schema_hosts_size performance_schema_max_cond_instances performance_schema_max_file_instances performance_schema_max_index_stat performance_schema_max_metadata_locks performance_schema_max_mutex_instances performance_schema_max_prepared_statements_instances performance_schema_max_program_instances performance_schema_max_rwlock_instances performance_schema_max_socket_instances performance_schema_max_table_handles performance_schema_max_table_instances performance_schema_max_table_lock_stat performance_schema_max_thread_instances performance_schema_users_size
N
N
N
memory/performance_schema/
memory_summary_global_by_event_name
xxx
SELECT * FROM memory_summary_global_by_event_name WHERE EVENT_NAME LIKE 'memory/performance_schema/%';
UNINSTALL
PLUGIN
events_waits_history_long
mutex_instances.LOCKED_BY_THREAD_ID
SELECT * FROM events_waits_current WHERE THREAD_ID = thread_1
;
events_waits_current.OBJECT_INSTANCE_BEGIN
SELECT * FROM mutex_instances WHERE OBJECT_INSTANCE_BEGIN = mutex_A
;
mutex_instances.LOCKED_BY_THREAD_ID
SELECT * FROM events_waits_current WHERE THREAD_ID = thread_2
;
SHOW
PROFILES
SHOW
PROFILE
setup_actors
TIMER_WAIT
SHOW PROFILES
SHOW PROFILE
setup_actors
MySQL的> SELECT * FROM performance_schema.setup_actors;
------ ------ ------ --------- --------- |主机|用户|作用|启用|历史| ------ ------ ------ --------- --------- | % % % | | |是|是| ------ ------ ------ --------- ---------
setup_actors
MySQL的> UPDATE performance_schema.setup_actors SET ENABLED = 'NO', HISTORY = 'NO' WHERE HOST = '%' AND USER = '%';
MySQL的> INSERT INTO performance_schema.setup_actors (HOST,USER,ROLE,ENABLED,HISTORY) VALUES('localhost','test_user','%','YES','YES');
setup_actors
MySQL的> SELECT * FROM performance_schema.setup_actors;
----------- ----------- ------ --------- --------- |主机|用户|作用|启用|历史| ----------- ----------- ------ --------- --------- | % % % | | |没有|没有| | localhost | test_user | % |是|是| ----------- ----------- ------ --------- ---------
setup_instruments
MySQL的> UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE '%statement/%';
MySQL的> UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE '%stage/%';
events_statements_*
mysql>UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%events_statements_%';
mysql>UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME LIKE '%events_stages_%';
mysql> SELECT * FROM employees.employees WHERE emp_no = 10001;
+--------+------------+------------+-----------+--------+------------+
| emp_no | birth_date | first_name | last_name | gender | hire_date |
+--------+------------+------------+-----------+--------+------------+
| 10001 | 1953-09-02 | Georgi | Facello | M | 1986-06-26 |
+--------+------------+------------+-----------+--------+------------+
EVENT_ID
events_statements_history_long
SHOW PROFILES
SHOW
PROFILES
MySQL的> SELECT EVENT_ID, TRUNCATE(TIMER_WAIT/1000000000000,6) as Duration, SQL_TEXT FROM performance_schema.events_statements_history_long WHERE SQL_TEXT like '%10001%';
+----------+----------+--------------------------------------------------------+| event_id | duration | sql_text |+----------+----------+--------------------------------------------------------+| 31 | 0.028310 | SELECT * FROM employees.employees WHERE emp_no = 10001 |+----------+----------+--------------------------------------------------------+
events_stages_history_long
EVENT_ID
MySQL的> SELECT event_name AS Stage, TRUNCATE(TIMER_WAIT/1000000000000,6) AS Duration FROM performance_schema.events_stages_history_long WHERE NESTING_EVENT_ID=31;
| -----------------------------选择阶段选择阶段的持续时间| | -------------------------------- | / SQL /启动阶段| 0.000080 | | SQL /检查/阶段/权限| 0.000005 | | SQL /开业/ |舞台表| 0.027759 | SQL /初始化阶段| 0.000052 | | SQL /系统/阶段/锁| 0.000009 | | | /优化SQL 0.000006 | | SQL /期/统计期| 0.000082 | | SQL /准备/阶段/ | 0.000008 | | SQL /执行| 0.000000 | |舞台/ SQL /发送数据| 0.000017 | | SQL /期/阶段/最终| 0.000001~| | SQL /查询端| 0.000004 | | SQL /阶段/闭幕表| 0.000006 | | SQL /阶段/项目|释放0.000272 | SQL /清洗/ |舞台上| 0.000001~| -----------------------------选择