26.4.5.15 ps_thread_id()函数

返回分配给给定连接 ID 的性能架构线程 ID,或者如果连接 ID 为NULL,则返回当前连接的线程 ID。

Parameters
  • in_connection_id BIGINT UNSIGNED:要为其返回线程 ID 的连接的 ID。这是 Performance Schema threadstable 的PROCESSLIST_ID列或SHOW PROCESSLIST输出的Id列中给定类型的值。
Return Value

BIGINT UNSIGNED值。

Example
mysql> SELECT sys.ps_thread_id(260);
+-----------------------+
| sys.ps_thread_id(260) |
+-----------------------+
|                   285 |
+-----------------------+