*
- in-memory hash
+
- in-memory b-tree
.tch
- on-disk hash
.tcb
- on-disk b-tree
.tcf
- fixed-length database
.tct
- table database
In-memory hash:
bnum
- number of bucketscapnum
- capacity number of recordscapsiz
- capacity size of memory, when exceeded removed via FIFO.
In-memory b-tree:
capnum
- capacity number of recordscapsiz
- capacity size of memory, when exceeded removed via FIFO.
On-disk hash:
mode
- w=writer, r=reader, c=create, t=truncate, e=nolock default=wcbnum
- main tuning parameter, should be > number of records, default=131071apow
- alignment power, default=4, so 2^4 = 16fpow
- maximum elements in free block pool, default=10, so 2^10=1024opts
- l=large (>2gb), d=default, b=bzip2, t=tcbsrcnum
- record cache, default=0 (disabled)xmsiz
- extra mapped memory region size, default is 67108864 (64mb)dfunit
- unit step for auto-defragmentation, default=0 (disabled).
On-disk b-tree:
mode
lmemb
- number of members in each leaf node, default=128nmemb
- number of members in each non-leaf node, default=256bnum
- main tuning parameter, > 1/128 number of records, default=32749apow
- alignment power, default=8, so 2^8=256fpow
- maximum elements in free block pool, default=10, so 2^10=1024opts
- l=large (>2gb), d=default, b=bzip2, t=tcbslcnum
- main tuning parameter, default is 1024, leaf-node cache sizencnum
- non-leaf nodes to cache, default=512xmsiz
- extra mapped memory region size, default=0 (disabled)dfunit
- unit step for auto-defragmentation, default=0 (disabled).
Fixed-length:
mode
width
- width of each value, default=255limsiz
- max size of database, default is 268435456 (256mb)
Table:
mode
bnum
- default is 131071, should be 0.5 - 4x number of recordsapow
- record alignment power, default=4, 2^4=16fpow
- maximum elements in free block pool, default=10, so 2^10=1024opts
- l=large (>2gb), d=default, b=bzip2, t=tcbsrcnum
- number of records to cache, default=0 (disabled)lcnum
- leaf-nodes to cache, default=4096ncnum
- non-leaf nodes to cache, default=512xmsiz
- extra mapped memory region size, default is 67108864 (64mb)dfunit
- unit step for auto-defragmentation, default=0 (disabled).idx
- field-name and type, separated by ":"
Supported by all databases:
log
- path to logfilelogkinds
- debug, info, warn or errorlogpx
- prefix for each log message
Other options:
bnum
- number of buckets in the hash tablecapcnt
- set capacity by record numbercapsiz
- set capacity by memory usagepsiz
- page sizepccap
- page-cache capacityopts
- s=small, l=linear, c=compress - l=linked-list for hash collisions.zcomp
- compression algorithm: zlib, def (deflate), gz, lzo, lzma or arczkey
- cipher key for compression (?)rcomp
- comparator function: lex, dec (decimal), lexdesc, decdescapow
- alignment power of 2fpow
- maximum elements in the free-block poolmsiz
- tune mapdfunit
- unit step for auto-defragmentation, default=0 (disabled).
Databases and available parameters:
- Stash - bnum
- Cache hash (
*
): opts, bnum, zcomp, capcnt, capsiz, zkey - Cache tree (
%
): opts, bnum, zcomp, zkey, psiz, rcomp, pccap - File hash (
.kch
): opts, bnum, apow, fpow, msiz, dfunit, zcomp, zkey - File tree (
.kct
): opts, bnum, apow, fpow, msiz, dfunit, zcomp, zkey, psiz, rcomp, pccap - Dir hash: (
.kcd
): opts, zcomp, zkey - Dir tree: (
.kcf
): opts, zcomp, zkey, psiz, rcomp, pccap - Plain-text: (
.kcx
): n/a
bnum
- default is ~1M, should be 80%-400% of total records
bnum
: default ~1M. Should be 50% - 400% of total records. Collision chaining is binary searchopts
: useful to reduce memory at expense of time effciency. Use compression if the key and value of each record is greater-than 1KBcapcnt
and/orcapsiz
: keep memory usage constant by expiring old records
Inherits all tuning options from the CacheHashDB, since each node of the btree is serialized as a page-buffer and treated as a record in the cache hash db.
psiz
: default is 8192pccap
: default is 64MBrcomp
: default is lexical ordering
bnum
: default ~1M. Suggested ratio is twice the total number of records, but can be anything from 100% - 400%.apow
: Power of the alignment of record size. Default=3, so the address of each record is aligned to a multiple of 8 (2^3
) bytes.fpow
: Power of the capacity of the free block pool. Default=10, rarely needs to be modified.msiz
: Size of internal memory-mapped region. Default is 64MB.dfunit
: Unit step number of auto-defragmentation. Auto-defrag is disabled by default.
apow, fpow, opts and bnum must be specified before a DB is opened and cannot be changed after the fact.
Inherits tuning parameters from the HashDB.
psiz
: default is 8192, specified before opening db and cannot be changedpccap
: default is 64MBrcomp
: default is lexical
The default alignment is 256 (2^8) and the default bucket number is ~64K. The bucket number should be calculated by the number of pages. Suggested ratio of bucket number is 10% of the number of records.