0
0
Fork 0
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:
Jason Volk 2020-12-05 05:51:10 -08:00
parent 9cdc6f8a47
commit 7751f9d0fa

View file

@ -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 *