-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kv: return information about number of keys/bytes processed #57322
Copy link
Copy link
Closed
Labels
A-kv-observabilityC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-kvKV TeamKV TeamX-staleno-issue-activity
Description
We have had various situations in which a scan did not return a lot of rows but was very slow, and the reason was because there were a lot of "invisible" keys with older MVCC values. Currently, there is no way for the SQL layer to obtain information about this (and show it with EXPLAIN ANALYZE).
I propose that KV returns (in ScanResponse) information about the number of underlying keys (and total bytes) that had to be processed to satisfy a ScanRequest. If collecting this information comes with performance overhead, we can add a flag in ScanRequest to only request it when necessary. This may apply to Get as well.
CC @asubiotto
Jira issue: CRDB-2835
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-kv-observabilityC-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-kvKV TeamKV TeamX-staleno-issue-activity