Note
This parameter was introduced in OceanBase Database V2.2.50.
Description
trace_log_slow_query_watermark specifies the execution time threshold to identify a slow query. Trace logs of slow queries are written to system logs.
Attributes
| Attribute | Description |
|---|---|
| Type | Time |
| Default value | 1s. The default unit is millisecond.
NoteThe default value has been changed from |
| Value range | [1ms,+∞) |
| Modifiable | Yes. You can use the ALTER SYSTEM SET statement to modify the parameter. |
| Effective upon OBServer node restart | No |
Considerations
You can determine whether a query is slow by comparing the SQL execution time with the value of trace_log_slow_query_watermark. If the SQL execution time exceeds the value of trace_log_slow_query_watermark, the query is considered a slow query. In this case, OceanBase Database records a slow query message in the OBServer log, allowing you to locate the slow query based on the OBServer log.
Example
obclient> ALTER SYSTEM SET trace_log_slow_query_watermark='100ms';