mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 08:12:37 +01:00
ircd:Ⓜ️:dbs: Add conf item toggling indexer prefetching.
This commit is contained in:
parent
c17c96d965
commit
c56b4a4ee9
2 changed files with 13 additions and 1 deletions
|
@ -21,6 +21,7 @@ namespace ircd::m::dbs
|
|||
// General confs
|
||||
extern conf::item<bool> cache_enable;
|
||||
extern conf::item<bool> cache_comp_enable;
|
||||
extern conf::item<bool> prefetch_enable;
|
||||
extern conf::item<size_t> mem_write_buffer_size;
|
||||
extern conf::item<size_t> sst_write_buffer_size;
|
||||
|
||||
|
|
|
@ -32,6 +32,17 @@ ircd::m::dbs::cache_comp_enable
|
|||
{ "default", false },
|
||||
};
|
||||
|
||||
/// Coarse toggle for the prefetch phase before the transaction building
|
||||
/// handlers (indexers) are called. If this is false, prefetching will be
|
||||
/// disabled; otherwise the write_opts passed to write() control whether
|
||||
/// prefetching is enabled.
|
||||
decltype(ircd::m::dbs::prefetch_enable)
|
||||
ircd::m::dbs::prefetch_enable
|
||||
{
|
||||
{ "name", "ircd.m.dbs.prefetch.enable" },
|
||||
{ "default", true },
|
||||
};
|
||||
|
||||
/// The size of the memory buffer for new writes to the DB (backed by the WAL
|
||||
/// on disk). When this buffer is full it is flushed to sorted SST files on
|
||||
/// disk. If this is 0, a per-column value can be used; otherwise this value
|
||||
|
@ -195,7 +206,7 @@ try
|
|||
};
|
||||
|
||||
size_t ret(0);
|
||||
if(likely(opts.prefetch))
|
||||
if(prefetch_enable && opts.prefetch)
|
||||
ret = _prefetch(txn, event, opts);
|
||||
|
||||
if(likely(opts.index))
|
||||
|
|
Loading…
Reference in a new issue