cockroachdb / cockroachdb/cockroach
sql: use latest MVCC version for table stat scans
Open
A-kv-transactions
A-sql-table-stats
A-storage
C-enhancement
T-storage
- Dominant language
- Go
- Stars
- 32.5k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
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
Contributor guide
Assessment
This issue has not been assessed yet.