文件首頁
MySQL 9.0 參考手冊
相關文件 下載本手冊
PDF (美式信紙) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 258.2Kb
Man Pages (Zip) - 365.3Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 參考手冊  /  ...  /  ps_is_thread_instrumented() 函數

30.4.5.13 ps_is_thread_instrumented() 函數

傳回 YESNO,表示是否為給定的連線 ID 啟用效能結構描述檢測,若 ID 未知則傳回 UNKNOWN,若 ID 為 NULL 則傳回 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                                            |
+------------------------------------------------+