Note
This parameter is introduced since 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 is changed from 100ms to 1s since OceanBase Database V3.2.3. |
| Value range | [1ms, +∞) |
| Modifiable | Yes. It can be modified using the ALTER SYSTEM SET statement. |
| Effective upon OBServer node restart | No |
Considerations
You can determine whether a query is slow by comparing the SQL execution time with the trace_log_slow_query_watermark value. If the SQL execution time exceeds the trace_log_slow_query_watermark value, it can be considered a slow query. In this case, OceanBase Database will print a slow query message in the OBServer log, allowing you to locate slow SQL through the OBServer log.
Examples
obclient> ALTER SYSTEM SET trace_log_slow_query_watermark='100ms';