Is there a way to know the size of all KVs that are stored in a column family?
Querying the size of a column family in RocksDB
1k Views Asked by Eshkod At
2
There are 2 best solutions below
1
On
If you want to know the total size of all SST files under a column family, a better way is via GetIntProperty(). In your case, you want to pass-in kTotalSstFileSize.
bool ok = db_->GetIntProperty(DB::Properties::kTotalSstFilesSize, &sst_size);
If you only care about the latest version of the SST files, then you should use kTotalLiveSstFileSize instead.
For API you can use:
GetApproximateSizes().If you just want to check, you can check RocksDB log, which has per column family
Compaction Stats, which SST file size for each level.It's not reporting column family size, but if you're interested in bytes written, there's a statistic reporting that:
rocksdb.bytes.written, you can get statistic by settingstatistics, like: