[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openldap-technical
Subject:    LMDB fix sized key and data question
From:       anton () pcloud ! com
Date:       2024-03-07 13:52:20
Message-ID: 170981954003.1014223.2119597967156763792 () hypatia ! openldap ! org
[Download RAW message or body]

Hello,

I'm designing an application that will use LMDB. All (or almost all) of my databases \
will have a fixed size integer key (64bit) and fixed size data. Data is larger than a \
single integer but generally in 16-32 bytes range (range is for different databases, \
each database has a fixed data format).

I'll not have duplicate key records. I'll mostly insert and retrieve single records. \
The question is would I benefit and should I use MDB_DUPSORT|MDB_DUPFIXED?  Also the \
documentation says that MDB_DUPFIXED may only be used with MDB_DUPSORT. However I see \
code that specifically checks for MDB_DUPFIXED without MDB_DUPSORT and only then sets \
a flag for DUPFIXED records. However I did not get too deep in the code.

https://github.com/LMDB/lmdb/blob/mdb.master/libraries/liblmdb/mdb.c#L7743

My point is that with fixed sized keys and values the btree may chose not to store \
record sizes, may not use pointers for the binary search but to search values instead \
and so on. Is that the optimization that is being done for MDB_DUPFIXED or is it \
something that only concerns duplicate values?

Best,

Anton


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic