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

Tuning parameters for the database. More...

#include <tkrzw_dbm_skip.h>

Public Member Functions

 TuningParameters ()
 Constructor. More...
 

Public Attributes

int32_t offset_width = -1
 The width to represent the offset of records. More...
 
int32_t step_unit = -1
 The step unit of the skip list. More...
 
int32_t max_level = -1
 The maximum level of the skip list. More...
 
int32_t restore_mode = RESTORE_DEFAULT
 How to restore the broken database file. More...
 
int64_t sort_mem_size = -1
 The memory size used for sorting to build the database in the at-random mode. More...
 
bool insert_in_order = false
 If true, records are assumed to be inserted in ascending order of the key. More...
 
int32_t max_cached_records = -1
 The maximum number of cached records. More...
 

Detailed Description

Tuning parameters for the database.

Constructor & Destructor Documentation

◆ TuningParameters()

tkrzw::SkipDBM::TuningParameters::TuningParameters ( )

Constructor.

Member Data Documentation

◆ offset_width

int32_t tkrzw::SkipDBM::TuningParameters::offset_width = -1

The width to represent the offset of records.

This determines the maximum size of the database and the footprint. -1 means that the default value 4 is set.

◆ step_unit

int32_t tkrzw::SkipDBM::TuningParameters::step_unit = -1

The step unit of the skip list.

This determines the search speed and the footprint of records. -1 means that the default value 4 is set.

◆ max_level

int32_t tkrzw::SkipDBM::TuningParameters::max_level = -1

The maximum level of the skip list.

This determines the search speed and the footprint of records. -1 means that the default value 14 is set.

◆ restore_mode

int32_t tkrzw::SkipDBM::TuningParameters::restore_mode = RESTORE_DEFAULT

How to restore the broken database file.

If the database file is not closed properly, when you open the file next time, it is considered broken. Then, restore operations are done implicitly. By default, the whole database is scanned to recover as many records as possible. As this parameter is not saved as a metadata of the database, it should be set each time when opening the database.

◆ sort_mem_size

int64_t tkrzw::SkipDBM::TuningParameters::sort_mem_size = -1

The memory size used for sorting to build the database in the at-random mode.

When total size of records exceeds this value, records are written in a temporary file and they are merged later. -1 means that the default value 256MB is set. As this parameter is not saved as a metadata of the database, it should be set each time when opening the database.

◆ insert_in_order

bool tkrzw::SkipDBM::TuningParameters::insert_in_order = false

If true, records are assumed to be inserted in ascending order of the key.

This assumption makes the insertions effective. As this parameter is not saved as a metadata of the database, it should be set each time when opening the database.

◆ max_cached_records

int32_t tkrzw::SkipDBM::TuningParameters::max_cached_records = -1

The maximum number of cached records.

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