Skip to content

Commit ebb6d30

Browse files
committed
scale outer_cache_size to config page_cache_MiB
1 parent 24b849e commit ebb6d30

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/genomicsqlite.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ string GenomicSQLiteURI(const string &dbfile, const string &config_json = "") {
188188
}
189189
}
190190
int threads = cfg.GetInt("$.threads");
191-
uri << "&outer_cache_size=-65536"
191+
uri << "&outer_cache_size=" << to_string(-64 * cfg.GetInt("$.page_cache_MiB"))
192192
<< "&threads=" << to_string(threads);
193193
if (threads > 1 && cfg.GetInt("$.inner_page_KiB") < 16 && !cfg.GetBool("$.force_prefetch")) {
194194
// prefetch is usually counterproductive if inner_page_KiB < 16
@@ -275,7 +275,7 @@ string GenomicSQLiteTuningSQL(const string &config_json, const string &schema =
275275
schema_prefix = schema + ".";
276276
}
277277
map<string, string> pragmas;
278-
pragmas[schema_prefix + "cache_size"] = to_string(-1024 * cfg.GetInt("$.page_cache_MiB"));
278+
pragmas[schema_prefix + "cache_size"] = to_string(-960 * cfg.GetInt("$.page_cache_MiB"));
279279
pragmas[schema_prefix + "max_page_count"] = "2147483646";
280280
if (schema_prefix.empty()) {
281281
int threads = cfg.GetInt("$.threads");

0 commit comments

Comments
 (0)