On Mon, 5 Jan 2015 14:42:28 -0600 Jay Kreibich <[email protected]> wrote:
> > > On Jan 5, 2015, at 12:25 PM, Jim Wilcoxson <[email protected]> wrote: > > > Simon - instead of using vacuum, it's much faster to create a new > > database from the old one, then rename it. It's easy to do this in > > Python using iterdump(), or you can connect to the new (empty) > > database, do your create table statements, attach the old database > > as olddb, then do: > > > > insert into table1 select * from olddb.table1; > > insert into table2 select 8 from olddb.table2; > > > > This also lets you do the create table stmts w/o indexes, and add > > the indexes after the inserts. Not sure if that is faster or not > > for your data. > > If you look at code for VACUUM, that’s more or less what it does… > only it is very smart about it, properly preserving ROWID values, as > well as exact table definitions, sequences, analytics, and all the > meta-data in the database. Sqlite3 Backup API should work too, and covers your vacuum to file proposal. You can, from sqlite3 shell, .dump the database to .sql file or pipe output to gzip or xz and use the compressed file for import again. Don't need full compression to minimize the io, -6 for gzip and -3 for xz is enough. > > -j --- --- Eduardo Morras <[email protected]> _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

