cockroachdb / cockroachdb/cockroach
sql: also trace COMMIT statements when sql.trace.stmt.enable_threshold is set
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Similar to #148175, explicit COMMIT statements can be a significant source of latency. When `sql.trace.stmt.enable_threshold` is set we should also include COMMIT statements. This would probably simply require moving the [statement threshold tracing setup](https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/conn_executor_exec.go#L1042-L1051) a little higher, above where we [handle commit statements](https://github.com/cockroachdb/cockroach/blob/147a4c01452aeab912945b0b57756d0cfd508701/pkg/sql/conn_executor_exec.go#L833-L836).
Contributor guide
Research direction
Start in pkg/sql/conn_executor_exec.go, reading the statement threshold tracing setup around lines 1042-1051 and the explicit COMMIT handling around lines 833-836. Confirm that threshold tracing also covers explicit COMMIT statements when sql.trace.stmt.enable_threshold is set, while preserving existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100