You can execute the KILL statement to kill an SQL thread that is running on a PolarDB-X instance.
Syntax
You can kill an SQL thread by using the following methods:
- Execute the following statement to kill the logical and physical SQL threads of a
connection, and then close the connection:
KILL PROCESS_IDNote- You can execute the
SHOW [FULL] PROCESSLISTstatement to query the value ofPROCESS_ID. - PolarDB-X does not support
KILL QUERY.
- You can execute the
- Execute the following statement to kill a specified physical SQL thread:
KILL 'PHYSICAL_PROCESS_ID'Examples
KILL '0-0-521570'; Query OK, 0 rows affected (0.01 sec)Note- You can execute the
SHOW PHYSICAL_PROCESS_IDstatement to query the value ofPHYSICAL_PROCESS_ID. - The value of
PHYSICAL_PROCESS_IDis a string instead of a numeric value. Therefore, you must enclose the value ofPHYSICAL_PROCESS_IDin double quotation marks (").
- You can execute the
- Kill all physical SQL threads that are running on a PolarDB-X instance.
KILL 'ALL'