MySQL 8.4 发行说明
以 JSON 格式返回给定线程 ID 的性能模式中所有语句、阶段和事件的堆栈。
in_thread_id BIGINT
: 要跟踪的线程的 ID。该值应与某个性能模式threads
表行中的THREAD_ID
列匹配。in_verbose BOOLEAN
: 是否在事件中包含file:lineno
信息。
mysql> SELECT sys.ps_thread_stack(37, FALSE) AS thread_stack\G
*************************** 1. row ***************************
thread_stack: {"rankdir": "LR","nodesep": "0.10",
"stack_created": "2014-02-19 13:39:03", "mysql_version": "8.4.0-tr",
"mysql_user": "root@localhost","events": [{"nesting_event_id": "0",
"event_id": "10", "timer_wait": 256.35, "event_info": "sql/select",
"wait_info": "select @@version_comment limit 1\nerrors: 0\nwarnings: 0\nlock time:
...