[RocksDB] [Performance Bug] MemTable::Get Slow

Summary:
The merge operator diff introduced a performance problem in MemTable::Get.
An exit condition is missed when the current key does not match the user key.
This could lead to full memtable scan if the user key is not found.

Test Plan: make check; db_bench

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D10851
This commit is contained in:
Haobo Xu 2013-05-20 21:28:09 -07:00
parent 3827403c51
commit c3c13db346

View File

@ -185,6 +185,9 @@ bool MemTable::Get(const LookupKey& key, std::string* value, Status* s,
return true;
}
}
} else {
// exit loop if user key does not match
break;
}
}