MySQL 8.0 参考手册 / 第 28 章 MySQL 系统模式 / 28.4 sys 模式对象参考 / 28.4.5 sys 模式存储函数 /
26.4.5.13 ps_is_thread_instrumented() 函数
返回YES
或NO
以指示是否启用给定连接 ID 的性能模式检测,UNKNOWN
如果 ID 未知,或者NULL
ID 是否为
NULL
。
in_connection_id BIGINT UNSIGNED
:连接ID。这是PROCESSLIST_ID
Performance Schemathreads
表的Id
列 或SHOW PROCESSLIST
输出列中给出的类型的值。
Press CTRL+C to copymysql> SELECT sys.ps_is_thread_instrumented(43); +-----------------------------------+ | sys.ps_is_thread_instrumented(43) | +-----------------------------------+ | UNKNOWN | +-----------------------------------+ mysql> SELECT sys.ps_is_thread_instrumented(CONNECTION_ID()); +------------------------------------------------+ | sys.ps_is_thread_instrumented(CONNECTION_ID()) | +------------------------------------------------+ | YES | +------------------------------------------------+