Search code examples
database-administrationrocksdb

Getting total number of key-value pairs in RocksDB


Is it possible to efficiently get the number of key-value pairs stored in a RocksDB key-value store?

I have looked through the wiki, and haven't seen anything discussing this topic thus far. Is such an operation even possible?


Solution

  • There is no way to get the count exactly. But in rocksdb 3.4 which released recently, it expose an way to get an estimate count for keys, you can try it.

    https://github.com/facebook/rocksdb/releases