cockroachdb / cockroachdb/cockroach
sql: collect statement diagnostics bundles on COMMIT
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
Explicit COMMIT can sometimes be a significant source of latency for multi-statement transactions. We should add support for collecting statement diagnostics bundles on COMMIT statements. (These would probably only contain traces.)
This might be close to working, since we currently [handle commit statements](https://github.com/cockroachdb/cockroach/blob/147a4c01452aeab912945b0b57756d0cfd508701/pkg/sql/conn_executor_exec.go#L833-L836) after [setting up the instrumentationHelper](https://github.com/cockroachdb/cockroach/blob/147a4c01452aeab912945b0b57756d0cfd508701/pkg/sql/conn_executor_exec.go#L566-L595). We're probably just missing:
- hooking up the proper tracing span for the commit code
- a way for `crdb_internal.request_statement_bundle` to match COMMIT statements
- syntactic support for `EXPLAIN ANALYZE (DEBUG) COMMIT`
Contributor guide
Assessment
This issue has not been assessed yet.