mirror of
https://github.com/matrix-construct/construct
synced 2024-12-27 07:54:05 +01:00
ircd::db: Optimize db::cached() query.
This commit is contained in:
parent
9cdc6f8a47
commit
7751f9d0fa
1 changed files with 9 additions and 8 deletions
17
ircd/db.cc
17
ircd/db.cc
|
@ -3100,19 +3100,20 @@ ircd::db::cached(column &column,
|
|||
const string_view &key,
|
||||
const gopts &gopts)
|
||||
{
|
||||
database &d(column);
|
||||
database::column &c(column);
|
||||
using rocksdb::Status;
|
||||
|
||||
auto opts(make_opts(gopts));
|
||||
opts.read_tier = NON_BLOCKING;
|
||||
opts.fill_cache = false;
|
||||
const auto status
|
||||
{
|
||||
_read(column, key, opts)
|
||||
};
|
||||
|
||||
std::unique_ptr<rocksdb::Iterator> it;
|
||||
if(!seek(c, key, opts, it))
|
||||
return false;
|
||||
|
||||
assert(bool(it));
|
||||
return valid_eq(*it, key);
|
||||
return false
|
||||
|| status.code() == Status::kOk
|
||||
|| status.code() == Status::kNotFound
|
||||
;
|
||||
}
|
||||
|
||||
rocksdb::Cache *
|
||||
|
|
Loading…
Reference in a new issue