`DB::GetApproximateSizes` should be the nearest what you need, there is not a `DB::GetApproximateNum` as exactly what you need.
But RocksDB's perf & compression is poor for your workload, you can try ToplingDB, a rocksdb fork which replace MemTable, SST, ... with more efficient one, esp its SST using a kind of index NestLoudsTrie which is searchable compression algo, typically 5x compression ratio while directly (point)search & scan on compressed form with 1,000,000+ QPS.