mirror of https://gitee.com/bigwinds/arangodb
use correct column families for size estimates (#2624)
This commit is contained in:
parent
690c2d17fd
commit
cb8014dbdd
|
@ -1136,7 +1136,7 @@ void RocksDBCollection::figuresSpecific(
|
|||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
|
||||
uint64_t out = 0;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::documents(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
|
||||
builder->add("documentsSize", VPackValue(out));
|
||||
}
|
||||
|
@ -1727,7 +1727,7 @@ void RocksDBCollection::estimateSize(velocypack::Builder& builder) {
|
|||
RocksDBKeyBounds bounds = RocksDBKeyBounds::CollectionDocuments(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out = 0, total = 0;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::documents(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
total += out;
|
||||
|
||||
builder.openObject();
|
||||
|
|
|
@ -417,8 +417,8 @@ size_t RocksDBEdgeIndex::memory() const {
|
|||
RocksDBKeyBounds bounds = RocksDBKeyBounds::EdgeIndex(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
return (size_t)out;
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::edge(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
return static_cast<size_t>(out);
|
||||
}
|
||||
|
||||
/// @brief return a VelocyPack representation of the index
|
||||
|
|
|
@ -101,8 +101,8 @@ size_t RocksDBFulltextIndex::memory() const {
|
|||
RocksDBKeyBounds::FulltextIndexPrefix(_objectId, StringRef());
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
return (size_t)out;
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::fulltext(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
return static_cast<size_t>(out);
|
||||
}
|
||||
|
||||
/// @brief return a VelocyPack representation of the index
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include "RocksDBEngine/RocksDBMethods.h"
|
||||
#include "RocksDBEngine/RocksDBToken.h"
|
||||
|
||||
#include <rocksdb/db.h>
|
||||
|
||||
using namespace arangodb;
|
||||
using namespace arangodb::rocksdbengine;
|
||||
|
||||
|
@ -317,8 +319,8 @@ size_t RocksDBGeoIndex::memory() const {
|
|||
RocksDBKeyBounds bounds = RocksDBKeyBounds::GeoIndex(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
return (size_t)out;
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::geo(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
return static_cast<size_t>(out);
|
||||
}
|
||||
|
||||
/// @brief return a JSON representation of the index
|
||||
|
|
|
@ -146,8 +146,8 @@ size_t RocksDBPrimaryIndex::memory() const {
|
|||
RocksDBKeyBounds bounds = RocksDBKeyBounds::PrimaryIndex(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
return (size_t)out;
|
||||
db->GetApproximateSizes(RocksDBColumnFamily::primary(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
return static_cast<size_t>(out);
|
||||
}
|
||||
|
||||
int RocksDBPrimaryIndex::cleanup() {
|
||||
|
|
|
@ -215,8 +215,8 @@ size_t RocksDBVPackIndex::memory() const {
|
|||
: RocksDBKeyBounds::IndexEntries(_objectId);
|
||||
rocksdb::Range r(bounds.start(), bounds.end());
|
||||
uint64_t out;
|
||||
db->GetApproximateSizes(&r, 1, &out, true);
|
||||
return (size_t)out;
|
||||
db->GetApproximateSizes(_unique ? RocksDBColumnFamily::uniqueIndex() : RocksDBColumnFamily::index(), &r, 1, &out, static_cast<uint8_t>(rocksdb::DB::SizeApproximationFlags::INCLUDE_MEMTABLES | rocksdb::DB::SizeApproximationFlags::INCLUDE_FILES));
|
||||
return static_cast<size_t>(out);
|
||||
}
|
||||
|
||||
/// @brief return a VelocyPack representation of the index
|
||||
|
|
Loading…
Reference in New Issue