Overview
long_query_time specifies the threshold for identifying a slow query. Queries with an execution time exceeding this value will be recorded in the slow query log.
Note
This variable is only for compatibility with MySQL. The related feature is not supported. You can query and set it, but the setting will not take effect without an error being returned.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.GLOBAL_VARIABLESview (in MySQL-compatible mode) to view the values of global system variables.Session level
Both the
systenant and all user tenants can use theSHOW VARIABLESstatement or theinformation_schema.SESSION_VARIABLESview (in MySQL-compatible mode) to view the values of session system variables.
Modify variables
Global effective
The
systenant can directly modify the values of global system variables.The user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session expiration
The
systenant and all user tenants can directly modify the values of session system variables for their own tenants.
Attributes
Attribute |
Description |
|---|---|
| Parameter type | Numeric |
| Default Value | 10, in seconds |
| Value range | [0, +∞) |
| Effective Scope |
|
| Modifiable | Yes, you can use theSETStatement modification. |
Configuration example
Set the slow query threshold to 10s.
Effective globally
obclient> SET GLOBAL long_query_time=10;Session expiration
obclient> SET long_query_time=10;