cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.16k stars 3.82k forks source link

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

Open tbg opened 7 hours ago

tbg commented 7 hours ago

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

blathers-crl[bot] commented 7 hours ago

This issue has multiple T-eam labels. Please make sure it only has one, or else issue synchronization will not work correctly.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.