1 Commits
Author SHA1 Message Date
clawbot 8d2ea50674 Keep the record count and total size in a totals table (closes #146)
check / check (push) Canceled after 0s
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
as before.

Model: opus-5-5
2026-10-27 16:32:38 +00:00
+2 -3
View File
@@ -32,9 +32,8 @@
- the database keeps the number of records and the sum of their sizes in the one
row of a `totals` table, which three triggers on `files` keep current. `info`
reads that row, and so do `scan`'s `load` phase and the `read` phases of
`report` and `trees` for their totals; no count reads every record any more. A
database made before this has no `totals` table and must be removed and
rescanned (2026-10-27, https://git.eeqj.de/sneak/sfdupes/issues/146)
`report` and `trees` for their totals; no count reads every record any more
(2026-10-27, https://git.eeqj.de/sneak/sfdupes/issues/146)
- an operand at or inside a directory named `.zfs` is never scanned, whether
given alone or under another operand. `scan` warns about it, counts it as