Tune SQLite caches and maintain planner statistics

This commit is contained in:
2026-10-06 14:05:02 -04:00
parent 283a553cc2
commit 18283c63a7
6 changed files with 48 additions and 0 deletions
+4
View File
@@ -190,6 +190,10 @@ after database changes, capture these timings under the same fleet load and run
`npm run diagnostics:database -- /data/cherry.db` inside the controller to report
the largest tables/indexes, database and WAL sizes, and free pages. This command
opens an existing database read-only and does not run app migrations.
The controller uses a 128 MiB page cache and each reader worker uses 32 MiB.
For a local data disk, set `EC_SQLITE_MMAP_MB=256` to enable memory-mapped reads.
Query statistics are optimized at startup and hourly; WAL reuse is capped at
64 MiB after checkpoints (active transactions can temporarily grow it larger).
Local controller
metadata defaults to `./data/cherry.db`; use a separate test database when