Skip to content

storage: MVCCGet showing significant MVCCIterator.Stats() CPU time #86083

@erikgrinaker

Description

@erikgrinaker

MVCCIterator.Stats() has been seen to use ~4% of CPU during MVCCGet benchmarks:

Screenshot 2022-08-13 at 17 15 06

This is used to attach iterator stats to a running trace, but the stats collection is called unconditionally (regardless of whether an actual trace is in progress):

cockroach/pkg/storage/mvcc.go

Lines 999 to 1000 in 9fb8d36

// If we have a trace, emit the scan stats that we produced.
recordIteratorStats(ctx, mvccScanner.stats())

Jira issue: CRDB-18562

Metadata

Metadata

Assignees

Labels

A-storageRelating to our storage engine (Pebble) on-disk storage.C-performancePerf of queries or internals. Solution not expected to change functional behavior.T-storageStorage Team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions