For format-v2 databases (open a new database withDocumentation Index
Fetch the complete documentation index at: https://hexxladb.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Options.EnableMVCC), you can configure retention policies and prune old versions to reclaim space.
Overview
MVCC retains multiple versions of data for time-travel queries. Without pruning, the database grows unbounded. Retention policies control how much history to keep.Configuring retention
- Retention is in commits, not wall-clock time
- Zero (default) disables automatic suggestions
- Only versions with strictly lower
commit_seqthan(header.CommitSeq - RetainCommitsBehindHead)may be reclaimed - Latest visible version per logical cell is never pruned
Mapping time to commits
Since retention is in commits, map your SLAs to commits based on observed commit rate:Pruning APIs
Get MVCC statistics
Suggested prune sequence
Explicit prune
Prune with profile
PruneProfileLowLatency— Aggressive pruning, minimal historyPruneProfileBalanced— Default balancePruneProfileLongHistory— Conservative pruning, more history
Prune scheduler
Recommended cadence
Run pruning during low-traffic windows:Pruning and compaction
Pruning marks versions as deleted but doesn’t immediately reclaim space. To reclaim space:MVCC btree errors during prune
Signal:PruneCellVersions or StatsMVCC ascent fails mid-operation with engine errors.
Response:
- Stop writing
- Backup files
- Restore from known-good snapshot
- Only use
Update/ primitives — avoid rawTx.Putreorderingcell/vs__meta/commit-time/keys on format v2
Performance considerations
- Pruning overhead: Depends on version count and batch size
- Batch size: Larger batches are more efficient but use more memory
- Compaction: Required to reclaim space after pruning
- Read performance: Unaffected by pruning (snapshot reads are fast)
Monitoring
Track these metrics:VersionedRowCount— Total versioned rows (should stabilize with pruning)LogicalCellCount— Unique cells (grows with data, not versions)CommitSeq— Current commit sequence (monotonically increasing)