MySQL 8.4 Release Notes
30.4.5.13 ps_is_thread_instrumented() 函数
返回 YES 或 NO 表示给定连接 ID 的性能模式仪器是否启用,UNKNOWN 表示 ID 未知,NULL 表示 ID 为 NULL。
-
in_connection_id BIGINT UNSIGNED: 连接 ID。这是性能模式threads表中PROCESSLIST_ID列或SHOW PROCESSLIST输出的Id列中给定类型的值。
一个 ENUM('YES','NO','UNKNOWN') 值。
mysql> 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 |
+------------------------------------------------+