Tkrzw
Public Member Functions | Public Attributes | List of all members
tkrzw::TreeDBM::TuningParameters Struct Reference

Tuning parameters for the database. More...

#include <tkrzw_dbm_tree.h>

Public Member Functions

 TuningParameters ()
 Constructor. More...
 
- Public Member Functions inherited from tkrzw::HashDBM::TuningParameters
 TuningParameters ()
 Constructor. More...
 

Public Attributes

int32_t max_page_size = -1
 The maximum size of a page. More...
 
int32_t max_branches = -1
 The maximum number of branches each inner node can have. More...
 
int32_t max_cached_pages = -1
 The maximum number of cached pages. More...
 
KeyComparator key_comparator = nullptr
 The comparator of record keys. More...
 
- Public Attributes inherited from tkrzw::HashDBM::TuningParameters
UpdateMode update_mode = UPDATE_DEFAULT
 How to update the database file. More...
 
int32_t offset_width = -1
 The width to represent the offset of records. More...
 
int32_t align_pow = -1
 The power to align records. More...
 
int64_t num_buckets = -1
 The number of buckets for hashing. More...
 
int32_t fbp_capacity = -1
 The capacity of the free block pool. More...
 
bool lock_mem_buckets = false
 Whether to lock the memory for the hash buckets. More...
 
bool cache_buckets = false
 Whether to cache the hash buckets on memory. More...
 

Detailed Description

Tuning parameters for the database.

Constructor & Destructor Documentation

◆ TuningParameters()

tkrzw::TreeDBM::TuningParameters::TuningParameters ( )

Constructor.

Member Data Documentation

◆ max_page_size

int32_t tkrzw::TreeDBM::TuningParameters::max_page_size = -1

The maximum size of a page.

If the size of a page exceeds this value, the page is divided into two. -1 means that the default value 4081 is set. -1 means that the default value 8130 is set.

◆ max_branches

int32_t tkrzw::TreeDBM::TuningParameters::max_branches = -1

The maximum number of branches each inner node can have.

The more the number of branches is, the less number of inner nodes occur. If the number is too large, updating performance deteriorates. -1 means that the default value 256 is set.

◆ max_cached_pages

int32_t tkrzw::TreeDBM::TuningParameters::max_cached_pages = -1

The maximum number of cached pages.

The more this value is, the better performance is whereas memory usage is increased. -1 means that the default value 10000 is set. As this parameter is not saved as a metadata of the database, it should be set each time when opening the database.

◆ key_comparator

KeyComparator tkrzw::TreeDBM::TuningParameters::key_comparator = nullptr

The comparator of record keys.

Records are put in the ascending order of this function. If this is one of built-in comparators, the type is stored in the database. Otherwise, the custom comparator must be specified every time when the database is opened. nullptr means that the default comparator LexicalKeyComparator is set.