I have LMDB files (about 20GB usually but may be larger) with several thousand Key-Value pairs each. The keys have not been inserted in their lexicographic order and I would like to know if there is a simple command to reorder an LMDB file according to the lexicographic order of the keys so that it translates to a sequential read access if data is read in that very order.
Thanks a lot!
Lmdb internally stores the keys in lexicographical order irrespective of the order in which they are inserted.
If you don't want keys to be sorted lexicographically, you can specify the comparison function to sort keys in lmdb using function mdb_set_compare().
The documentation of key sorting and mdb_set_compare() function is mentioned in the below link.