26.4.5.16 ps_thread_stack()函数

对于给定的线程 ID,返回 Performance Schema 中所有语句,阶段和事件的 JSON 格式的堆栈。

Parameters
  • in_thread_id BIGINT:要跟踪的线程的 ID。该值应与“性能模式threads”table 行中的THREAD_ID列匹配。

  • in_verbose BOOLEAN:是否在事件中包括file:lineno条信息。

Return Value

LONGTEXT CHARACTER SET latin1值。

Example
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": "5.7.3-m13",
"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:
...