Turn on auto-vacuuming, which keeps file size down after deletes and prevents DB fragmentation

This can't be enabled on databases with existing tables, so for existing users we can either a) add a FAQ with instructions to recreate and let the advanced users do it and let everyone else have larger tables or b) add a migration step to dump to a new file and then replace the old with the new, which may be a risky and not all that easy proposition (given the lack of .dump) but might work...

The steps, by the way, with Firefox closed:

$ sqlite3 zotero.sqlite
sqlite> .out dump.sql
sqlite> .quit
$ sqlite3 db.sqlite
sqlite> PRAGMA auto_vacuum = 1;
sqlite> .read dump.sql
sqlite> .quit
$ mv db.sqlite zotero.sqlite
This commit is contained in:
Dan Stillman 2006-10-11 09:44:20 +00:00
parent 081b544688
commit c0eb1746db

View File

@ -311,6 +311,9 @@ Zotero.Schema = new function(){
function _initializeSchema(){
Zotero.DB.beginTransaction();
try {
// Enable auto-vacuuming
Zotero.DB.query("PRAGMA auto_vacuum = 1");
Zotero.DB.query(_getSchemaSQL('userdata'));
_updateDBVersion('userdata', _getSchemaSQLVersion('userdata'));