libmdbx 0.13.1.27 (2024-10-08T18:14:15+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
 
Loading...
Searching...
No Matches
mdbx::env::reclaiming_options Struct Reference

Garbage reclaiming options. More...

#include <mdbx.h++>

Public Member Functions

constexpr reclaiming_options () noexcept
 
constexpr reclaiming_options (const reclaiming_options &) noexcept=default
 
constexpr reclaiming_optionsoperator= (const reclaiming_options &) noexcept=default
 
 reclaiming_options (MDBX_env_flags_t) noexcept
 

Public Attributes

bool lifo {false}
 
bool coalesce {false}
 

Detailed Description

Garbage reclaiming options.

Constructor & Destructor Documentation

◆ reclaiming_options() [1/3]

constexpr mdbx::env::reclaiming_options::reclaiming_options ( )
inlineconstexprnoexcept

◆ reclaiming_options() [2/3]

constexpr mdbx::env::reclaiming_options::reclaiming_options ( const reclaiming_options )
constexprdefaultnoexcept

◆ reclaiming_options() [3/3]

mdbx::env::reclaiming_options::reclaiming_options ( MDBX_env_flags_t  )
noexcept

Member Function Documentation

◆ operator=()

constexpr reclaiming_options & mdbx::env::reclaiming_options::operator= ( const reclaiming_options )
constexprdefaultnoexcept

Member Data Documentation

◆ coalesce

bool mdbx::env::reclaiming_options::coalesce {false}

Aims to coalesce a Garbage Collection items.

Deprecated:
Always enabled since v0.12 and deprecated since v0.13.

With MDBX_COALESCE flag MDBX will aims to coalesce items while recycling a Garbage Collection. Technically, when possible short lists of pages will be combined into longer ones, but to fit on one database page. As a result, there will be fewer items in Garbage Collection and a page lists are longer, which slightly increases the likelihood of returning pages to Unallocated space and reducing the database file.

This flag may be changed at any time using mdbx_env_set_flags().

◆ lifo

bool mdbx::env::reclaiming_options::lifo {false}

LIFO policy for recycling a Garbage Collection items.

MDBX_LIFORECLAIM flag turns on LIFO policy for recycling a Garbage Collection items, instead of FIFO by default. On systems with a disk write-back cache, this can significantly increase write performance, up to several times in a best case scenario.

LIFO recycling policy means that for reuse pages will be taken which became unused the lastest (i.e. just now or most recently). Therefore the loop of database pages circulation becomes as short as possible. In other words, the number of pages, that are overwritten in memory and on disk during a series of write transactions, will be as small as possible. Thus creates ideal conditions for the efficient operation of the disk write-back cache.

MDBX_LIFORECLAIM is compatible with all no-sync flags, but gives NO noticeable impact in combination with MDBX_SAFE_NOSYNC or MDBX_UTTERLY_NOSYNC. Because MDBX will reused pages only before the last "steady" MVCC-snapshot, i.e. the loop length of database pages circulation will be mostly defined by frequency of calling mdbx_env_sync() rather than LIFO and FIFO difference.

This flag may be changed at any time using mdbx_env_set_flags().


The documentation for this struct was generated from the following file: