Note
This variable is available starting with V2.2.77. This variable is only for compatibility with MySQL. The related features are not supported. You can query and set this variable. The setting will not take effect, but no error will be returned.
Description
long_query_time specifies the threshold for slow queries. Queries that take longer than this threshold will be recorded in the slow query log.
Applicability
This variable is applicable only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
Global level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to obtain the value of a Global system variable.Session level
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL mode) to obtain the value of a Session system variable.
Modify variables
Global level
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
systenant and all user tenants can directly modify the value of a Session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Numeric |
| Default value | 10 seconds |
| Value range | [0, +∞) |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Examples
Set the threshold for slow queries to 10 seconds.
Global level
obclient> SET GLOBAL long_query_time=10;Session level
obclient> SET long_query_time=10;
