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