文件首頁
MySQL 8.4 參考手冊
相關文件 下載本手冊
PDF (US Ltr) - 39.9Mb
PDF (A4) - 40.0Mb
Man Pages (TGZ) - 258.5Kb
Man Pages (Zip) - 365.5Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


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

30.4.5.13 ps_is_thread_instrumented() 函數

傳回 YESNO,以表示是否啟用指定連線 ID 的 Performance Schema 檢測,如果 ID 未知則傳回 UNKNOWN,如果 ID 為 NULL 則傳回 NULL

參數
  • in_connection_id BIGINT UNSIGNED:連線 ID。這是 Performance Schema 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                                            |
+------------------------------------------------+