leveldb icon indicating copy to clipboard operation
leveldb copied to clipboard

How can I efficiently create sublevel?

Open anidotnet opened this issue 4 years ago • 1 comments

How do I efficiently create sublevel db with different comparator? Do you have any example or test case?

anidotnet avatar Jul 30 '20 11:07 anidotnet

Leveldb does not support sublevel with multiple comparators. You can achieve this by creating a distinct DB for each sublevel or a better approach (depending on the usecase) would be to use a key prefix to differentiate each sublevel and make a single comparator aware of those prefixes/sublevel comparators.

pcmind avatar Sep 14 '20 16:09 pcmind