Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: optimize sql statement/txn statistics (functionality gated behind sql.metrics.statement_details.enabled), 1.62% improvement on microbenchmark #135996

Open
tbg opened this issue Nov 22, 2024 · 1 comment
Labels
branch-master Failures and bugs on the master branch. C-performance Perf of queries or internals. Solution not expected to change functional behavior. o-perf-efficiency Related to performance efficiency P-2 Issues/test failures with a fix SLA of 3 months T-observability

Comments

@tbg
Copy link
Member

tbg commented Nov 22, 2024

As can be seen on the right here, disabling sql.metrics.statement_details.enabled improves peak throughput.

image

internal Slack thread

Microbenchmark shows:

$ benchdiff  ./pkg/sql/tests -b -r 'Sysbench/SQL/3node/oltp_read_write' -d 1000x -c 10

name                                   old time/op    new time/op    delta
Sysbench/SQL/3node/oltp_read_write-24    14.1ms ± 1%    13.9ms ± 1%  -1.62%  (p=0.000 n=10+10)

name                                   old alloc/op   new alloc/op   delta
Sysbench/SQL/3node/oltp_read_write-24    2.59MB ± 1%    2.54MB ± 0%  -2.22%  (p=0.000 n=8+7)

name                                   old allocs/op  new allocs/op  delta
Sysbench/SQL/3node/oltp_read_write-24     17.7k ± 1%     17.5k ± 1%  -1.63%  (p=0.000 n=10+10)

"After" is with this diff:

image

Epic: CRDB-42584

Jira issue: CRDB-44822

@tbg tbg added C-performance Perf of queries or internals. Solution not expected to change functional behavior. branch-master Failures and bugs on the master branch. P-2 Issues/test failures with a fix SLA of 3 months T-observability o-perf-efficiency Related to performance efficiency labels Nov 22, 2024

This comment was marked as resolved.

@tbg tbg changed the title sql: optimize sql statement/txn statistics (functionality gated behind sql.metrics.statement_details.enabled) sql: optimize sql statement/txn statistics (functionality gated behind sql.metrics.statement_details.enabled), 1.62% improvement on microbenchmark Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-performance Perf of queries or internals. Solution not expected to change functional behavior. o-perf-efficiency Related to performance efficiency P-2 Issues/test failures with a fix SLA of 3 months T-observability
Projects
None yet
Development

No branches or pull requests

1 participant