
3/18/2026 · Clément Renault
What this post added
This post details the implementation of nested read transactions in LMDB, allowing multiple threads to read from an uncommitted write transaction. This was achieved by patching LMDB to modify the behavior of `mdb_txn_begin` and implementing an atomic reference-counted system. The new API was integrated into Hannoy, Meilisearch's HNSW implementation, by replacing the `ImmutableItems` and `ImmutableLinks` data structures with a wrapper for nested read transactions that lazily fetches items and graph links on demand. This optimization resulted in a 3x speedup for Meilisearch's vector store.