Skip to content

sql: use latest MVCC version for table stat scans #158604

@RaduBerinde

Description

@RaduBerinde

Pebble optimizes the retrieval of the latest MVCC version for each key. The table statistics scan results in reads that are not for the latest version, which is not ideal.

We should update the scan to not use a timestamp at all, and instead just retrieve the latest version of each key (it is ok to use even a non-committed version). This would be beneficial for the resulting statistics as well.

This will probably require some minor work in KV to allow this type of scan.

CC @jbowens @sumeerbhola

Jira issue: CRDB-57411

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-kv-transactionsRelating to MVCC and the transactional model.A-sql-table-statsTable statistics (and their automatic refresh).A-storageRelating to our storage engine (Pebble) on-disk storage.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)T-storageStorage Team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions