Class Yabu.LookupDB

Inheritance graph
Yabu.DB Yabu.LookupDB
Description

This database is optimized for lots of very small data records (a few bytes each, usually), but the API is otherwise identical to the normal DB API.

It will perform badly if used with big records. You also need to know in advance aproximately how many keys there will be, the performance will degrade if way more than the expected number of keys are present.


Inherit DB

inherit DB : DB


Method create

Yabu.LookupDB Yabu.LookupDB(string dir, string mode, mapping|void options)

Description

Construct a new lookup table.

The options, if present, can be used to specify the index hash size. The bigger that number is, the less memory will be used given a certain number of actual keys. In general, using the expected number of entries in the database divided by 100-1000 is reasonable.

The supported options are

index_size : int(1..)