Keep the record count and total size in a totals table (closes #146) #148

Merged
clawbot merged 1 commits from issue-146-stored-totals into next 2026-10-27 18:59:37 +01:00
1 Commits
Author SHA1 Message Date
clawbot 61ee49a905 Keep the record count and total size in a totals table (closes #146)
check / check (push) Waiting to run
info counted the records and added up their sizes with a query that
reads every record, which takes minutes on a large database. The
schema now has a totals table of one row, kept current by three
triggers on files, in the transaction of each insert, delete and size
update. info, scan's load phase and the read phases of report and
trees read that row instead of counting over files. scan writes files
with the same statements as before. Each of those writes now fires a
trigger and is slower, so scan keeps SQLite's temporary data in
memory, which wins back part of that time.

Model: opus-5-5
2026-10-27 17:38:37 +00:00