diff options
author | Christopher Baines <mail@cbaines.net> | 2020-05-25 11:08:20 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-05-25 11:08:20 +0100 |
commit | 9265949cf669b9e861bc85a1f1c3954cf4e216cc (patch) | |
tree | 89579191bda64514cbd4d5023bf33081a8b7c089 /bin | |
parent | 68a6912ce2e5d281bc7b45bf447b7695f5425388 (diff) | |
download | cuirass-9265949cf669b9e861bc85a1f1c3954cf4e216cc.tar cuirass-9265949cf669b9e861bc85a1f1c3954cf4e216cc.tar.gz |
cuirass: Perform some database "optimization" at startup.
Add a "optimize" step that occurs when starting up the main Curiass
process. Currently this does two things, but could be extended to do more.
The "PRAGMA optimize;" command prompts SQLite to ANALYZE tables where that
might help. The "PRAGMA wal_checkpoint(TRUNCATE);" command has SQLite process
any unprocessed changes from the WAL file, then truncate it to 0 bytes. I've
got no data to suggest this helps with performance, but I'm hoping that going
from a large WAL file to a small one occasionally might be useful.
* src/cuirass/database.scm (db-optimize): New procedure.
* bin/cuirass.in (main): Run it.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/cuirass.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/cuirass.in b/bin/cuirass.in index fbc7c3c..7a2d5ae 100644 --- a/bin/cuirass.in +++ b/bin/cuirass.in @@ -124,6 +124,10 @@ exec ${GUILE:-@GUILE@} --no-auto-compile -e main -s "$0" "$@" (min (current-processor-count) 4)))) (prepare-git) + (unless (option-ref opts 'web #f) + (log-message "performing database optimizations") + (db-optimize)) + (log-message "running Fibers on ~a kernel threads" threads) (run-fibers (lambda () |