Struct MDBX_cache_entry_t
ClassList > MDBX_cache_entry_t
Lightweight transparent cache entry structure used by mdbx_cache_get() .More...
#include <mdbx.h>
Inherited by the following classes: mdbx::cache_entry
Public Attributes
| Type | Name |
|---|---|
| uint64_t | last_confirmed_txnid |
| uint32_t | length |
| size_t | offset |
| uint64_t | trunk_txnid |
Detailed Description
The approach of these caching is to preserve address of a value retrieved from the database with an extremely fast check of relevance it based on a transaction ID within an internal b-tree structures. Event a b-tree was modified then the search for the corresponding key from the root of the b-tree to leaf pages stops as soon as reaches a page that has not been modified after the last check of given cache entry. This way, the minimum actions is performed, which is no slower than a usual key search in the worst case, and at best, only a few lightweight checks will be do.
Note:
The cache structure allows it to be placed in shared memory and used by multiple processes. However, such interaction and management are not provided by libmdbx in any way yet now.
Note:
An each cache entry must be initialized by mdbx_cache_init() before first use.
Public Attributes Documentation
variable last_confirmed_txnid
uint64_t MDBX_cache_entry_t::last_confirmed_txnid;
The recent transaction/MVCC-snapshot ID wherein the cache entry was checked and confirmed.
variable length
uint32_t MDBX_cache_entry_t::length;
The length of cached data value for a corresponding key.
variable offset
size_t MDBX_cache_entry_t::offset;
The offset of cached data value for a corresponding key. The zero value means MDBX_NOTFOUND.
variable trunk_txnid
uint64_t MDBX_cache_entry_t::trunk_txnid;
The transaction/MVCC-snapshot ID of a page or other internal DB structure that hold the cached data or reflect it state.
The documentation for this class was generated from the following file docs/mdbx.h