Documentation Home
MySQL 8.4 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 39.8Mb
PDF (A4) - 39.9Mb
Man Pages (TGZ) - 257.9Kb
Man Pages (Zip) - 364.9Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 8.4 Reference Manual  /  ...  /  The ps_thread_stack() Function

30.4.5.16 PS_thread_stack()函数

返回一个JSON格式的线程栈,包含了Performance Schema中关于给定线程ID的所有语句、阶段和事件。

  • in_thread_id BIGINT: 需要跟踪的线程ID。该值应该与threads表中的THREAD_ID列相匹配。

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

一个长度为LONGTEXT CHARACTER SET latin1的值。

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:
...