Skip to content

Commit

Permalink
imporve 'scan' performance for #309
Browse files Browse the repository at this point in the history
  • Loading branch information
yinqiwen committed Feb 5, 2017
1 parent 5f3457d commit a9bc2ed
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/.kv_engine
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lmdb
rocksdb
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ else
ifeq ($(storage_engine), rocksdb)
STORAGE_ENGINE=$(ROCKSDB_LIBA)
STORAGE_ENGINE_PATH=$(ROCKSDB_PATH)
INCS+=-I${ROCKSDB_PATH}/include
INCS+=-I${ROCKSDB_PATH}/include -I${ROCKSDB_PATH}
LIBS:= ${ROCKSDB_LIBA} ${SNAPPY_LIBA} ${LIBS} -lz -lbz2
CXXFLAGS+=-D__USE_ROCKSDB__ -std=c++11
else
Expand Down
4 changes: 3 additions & 1 deletion src/command/keys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ OP_NAMESPACE_BEGIN
{
if (k.GetType() != KEY_META)
{
iter->Next();
//iter->Next();
KeyObject next(ctx.ns, KEY_END, k.GetKey());
iter->Jump(next);
continue;
}
k.GetKey().ToString(match_element);
Expand Down
2 changes: 2 additions & 0 deletions src/db/rocksdb/rocksdb_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "thread/spin_mutex_lock.hpp"
#include "db/db.hpp"


OP_NAMESPACE_BEGIN

static inline rocksdb::Slice to_rocksdb_slice(const Slice& slice)
Expand Down Expand Up @@ -1309,6 +1310,7 @@ OP_NAMESPACE_BEGIN
std::map<rocksdb::MemoryUtil::UsageType, uint64_t> usage_by_type;
std::unordered_set<const rocksdb::Cache*> cache_set;
std::vector<rocksdb::DB*> dbs(1, m_db);
cache_set.insert(m_db->GetDBOptions().row_cache.get());
rocksdb::MemoryUtil::GetApproximateMemoryUsageByType(dbs, cache_set, &usage_by_type);
for (size_t i = 0; i < rocksdb::MemoryUtil::kNumUsageTypes; ++i)
{
Expand Down

0 comments on commit a9bc2ed

Please sign in to comment.