1
0
Fork 0

Increase the nav-cache in-memory cache size.

(Avoid thrash in certain cases)
This commit is contained in:
James Turner 2013-01-19 13:58:22 +00:00
parent 1f3b13738c
commit a138952ee5

View file

@ -72,7 +72,8 @@ namespace {
const int MAX_RETRIES = 10;
const int SCHEMA_VERSION = 6;
const int CACHE_SIZE_KBYTES= 16000;
// bind a std::string to a sqlite statement. The std::string must live the
// entire duration of the statement execution - do not pass a temporary
// std::string, or the compiler may delete it, freeing the C-string storage,
@ -248,6 +249,11 @@ public:
}
}
// see http://www.sqlite.org/pragma.html#pragma_cache_size
// for the details, small cache would cause thrashing.
std::ostringstream q;
q << "PRAGMA cache_size=-" << CACHE_SIZE_KBYTES << ";";
runSQL(q.str());
prepareQueries();
}