Secondary Indexes and Versioned Table Updates
Maintain an alternate key from the same logical update and ensure stale index information cannot cause visible duplicate or missing rows.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
A table change can modify several access paths
If a record’s status changes from pending to complete, an index keyed by status must reflect that change under the transaction’s visibility rules. The update can add a new index entry, remove or retire an old one, and keep a record reference. These actions need a recovery and concurrency contract so a reader’s allowed view is consistent. Maintaining each additional index increases work on updates affecting its fields.
Index entries and row eligibility differ
An engine can retain old entries for earlier snapshots or use deferred cleanup. A lookup must validate version eligibility at the appropriate layer. Enforcing uniqueness also needs concurrent decisions about new entries sharing keys. Slotted pages explain physical record references. Index-only scans discuss when index data and visibility are enough without a row read.[1][2]