I had 2 tables in the encrypted file (file size 4.5Gb) with a column holding small blobs (serialized types). I dropped these tables and tried the vacuum again, but it failed
again, this time with a silent crash. There are no rows holding large amounts of data, they are all simple strings and numbers. Also I ran PRAGMA INTEGRITY_CHECK and that showed OK.
I ran the vacuum with an unfiltered log and attached that log, which was running during that silent crash.
I am not sure what to look for in this file, but maybe somebody knows.
RBS
Slight progress by looking at the result of pragma freelist_count:
From the book Using SQLite by Jay A.Kreibich:
The freelist_count pragma returns a single integer indicating how many database pages are currently marked as free and available (contain no valid data).
These pages can be recovered by vacuuming the database.
I dropped a table and ran that pragma and it returned 7.
I then ran the vacuum and finished fine. I missed the message of the reduction in bytes, but when I ran again that pragma it returned 0, indicating that the
vacuum had at least done something.
I then copied the database to PC and ran that pragma in DB Browser and it showed the same 0.
As the size of the DB was still 4.5 Gb rather than the 3.8 Gb after I ran the vacuum in DB Browser a few days ago I ran a vacuum (although maybe with that
pragma returning 0 it was to expected it wouldn't work) and it returned with an error:
Execution finished with errors: Database or disc is full.
Not sure what to make of all this, but at least I have run one vacuum on the phone app that has done something and without a crash.
The other thing is that maybe it makes sense to run pragma freelist_count before doing a vacuum and if it return 0 and don't do the vacuum.
RBS