ldb: set `total_order_seek` for scans (#5066)

Summary:
Without `total_order_seek=true`, using this command with `prefix_extractor` set skips over lots of keys.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5066

Differential Revision: D14425967

Pulled By: sagar0

fbshipit-source-id: f6f142733258d92604f920615be9266e1fe797f8
main
Andrew Kryczka 5 years ago committed by Facebook Github Bot
parent 8a1ecd1982
commit 5a5c0492db
  1. 8
      tools/ldb_cmd.cc

@ -1469,7 +1469,9 @@ void DBDumperCommand::DoDumpCommand() {
}
// Setup key iterator
Iterator* iter = db_->NewIterator(ReadOptions(), GetCfHandle());
ReadOptions scan_read_opts;
scan_read_opts.total_order_seek = true;
Iterator* iter = db_->NewIterator(scan_read_opts, GetCfHandle());
Status st = iter->status();
if (!st.ok()) {
exec_state_ =
@ -2325,7 +2327,9 @@ void ScanCommand::DoCommand() {
}
int num_keys_scanned = 0;
Iterator* it = db_->NewIterator(ReadOptions(), GetCfHandle());
ReadOptions scan_read_opts;
scan_read_opts.total_order_seek = true;
Iterator* it = db_->NewIterator(scan_read_opts, GetCfHandle());
if (start_key_specified_) {
it->Seek(start_key_);
} else {

Loading…
Cancel
Save