Note
This variable was introduced in OceanBase Database V2.2.77.
Description
The long_query_time variable specifies the threshold for slow queries. Queries that take longer than this value are recorded in the slow query log.
Applicability
This variable applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or view theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to query the values of global system variables.Session level
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or view theinformation_schema.SESSION_VARIABLESview (MySQL mode) to query the values of session system variables.
Modify variables
Global level
The
systenant can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
The
systenant and all user tenants can directly modify the value of a session system variable in their respective tenants.
Attributes
| Attribute | Description |
|---|---|
| Type | Numeric |
| Default value | 10, in seconds |
| Value range | [0, +∞) |
| Applicability |
|
| Modifiable | Yes. You can modify this variable by using the SET statement. |
Examples
Set the threshold for slow queries to 10s.
Global level
obclient> SET GLOBAL long_query_time=10;Session level
obclient> SET long_query_time=10;