Failure messages with `PRAGMA optimize`
Author: kenkendkCreated Feb 14, 2025Updated Sep 25, 2026
Labelsbug
It looks like the the automatically created index feature in SQLite clashes with the PRAGMA optimize command.
If there are cases where SQLite will register an automatic index, it will emit a warning, such as:
SQLite warning (284): automatic index on B(BlocksetID)Later when running PRAGMA optimize this fails with the message:
SQLite error (17): statement aborts at 27: [PRAGMA optimize] database schema has changedMost likely the problem is that the automatic index registers as a schema change, and this prevents the optimize from being used.
If so, the fix is to identify the places where the automatic index is registered, and issue a schema change that registers these index changes from the start, to avoid problems with the optimize call.
Source: duplicati/duplicati