cockroachdb / cockroachdb/cockroach

sql: collect statement diagnostics bundles on COMMIT

Open
#148,175 2 comments 0 reactions 0 assignees View on GitHub
A-sql-debug-bundle A-sql-explain C-enhancement O-support P-3 T-sql-queries
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.