Extend Top SQL resource dimensions with logical read/write and RocksDB block reads
Author: jiong-nbaCreated Jul 24, 2026Updated Sep 16, 2026
Labelstype/enhancementcontributionfirst-time-contributorneeds-cherry-pick-release-8.5affects-8.5component/observability
Enhancement
Extend TiKV Top SQL / resource metering with finer-grained resource dimensions:
- Split the existing logical IO into logical read and logical write dimensions.
- Add foreground RocksDB block-read count deltas (physical-read IO approximation) to resource usage records.
- Select Top-N candidates per resource dimension; reported groups are their union and can exceed
max_resource_groups. - Attribute conditional reads in raw compare-and-swap; exclude batched Raftstore apply/store write workers.
Related Work
TiKV
kvproto
- resource_usage_agent: add RocksDB block read count pingcap/kvproto#1498
- Tracking issue: https://github.com/pingcap/kvproto/issues/1507
TiDB (upstream tracking)
Source: tikv/tikv