Skip to content

kv: return information about number of keys/bytes processed #57322

@RaduBerinde

Description

@RaduBerinde

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions