When I was trying to change the db engine to badgerdb in some of my projects, I found the iterator Seek with prefix was pretty slow in the following situation:
- lots of keys we were seeking with prefix didn’t exist
- lots of keys have lots of versions
So I fix this by skipping the
parseItem process when the current key is not match the prefix.
when keys in badger has lots of versions, then iterator.Seek a prefix that didn’t exist.
It was quite slow in compare with leveldb, even in minuts total when seeking 30000 non-existent prefix