db: add query option to bypass cache
With the option enabled, we bypass the cache unconditionally and only read from memtables+sstables. This is useful for analytics queries.
This commit is contained in:
@@ -675,7 +675,7 @@ table::make_reader(schema_ptr s,
|
||||
readers.emplace_back(mt->make_flat_reader(s, range, slice, pc, trace_state, fwd, fwd_mr));
|
||||
}
|
||||
|
||||
if (_config.enable_cache) {
|
||||
if (_config.enable_cache && !slice.options.contains(query::partition_slice::option::bypass_cache)) {
|
||||
readers.emplace_back(_cache.make_reader(s, range, slice, pc, std::move(trace_state), fwd, fwd_mr));
|
||||
} else {
|
||||
readers.emplace_back(make_sstable_reader(s, _sstables, range, slice, pc, std::move(trace_state), fwd, fwd_mr));
|
||||
|
||||
@@ -100,7 +100,7 @@ constexpr auto max_rows = std::numeric_limits<uint32_t>::max();
|
||||
class partition_slice {
|
||||
public:
|
||||
enum class option { send_clustering_key, send_partition_key, send_timestamp, send_expiry, reversed, distinct, collections_as_maps, send_ttl,
|
||||
allow_short_read, with_digest };
|
||||
allow_short_read, with_digest, bypass_cache };
|
||||
using option_set = enum_set<super_enum<option,
|
||||
option::send_clustering_key,
|
||||
option::send_partition_key,
|
||||
@@ -111,7 +111,8 @@ public:
|
||||
option::collections_as_maps,
|
||||
option::send_ttl,
|
||||
option::allow_short_read,
|
||||
option::with_digest>>;
|
||||
option::with_digest,
|
||||
option::bypass_cache>>;
|
||||
clustering_row_ranges _row_ranges;
|
||||
public:
|
||||
std::vector<column_id> static_columns; // TODO: consider using bitmap
|
||||
|
||||
Reference in New Issue
Block a user