On Jul 2, 2008, at 11:07 PM, Ken wrote: > > So if I insert large amounts of data, this data would be written to > disk > twice: once into a replay journal, and then again into the database > file > on commit. With rollback journal, it is written once into the database > (with rollback journal merely noting which new pages have been > created), > and commit is nearly instantaneous. I'd rather optimize for the common > case (transactions successfully committed) than the exceptional one. >
Upon first reading, I thought you were saying that the use of a rollback journal always writes the data only once, which is (of course) not true. In the common case where you are making a change to the database without extending it, the data is still written twice - once to the journal and once to the database. You are correct, however, that when extending the size of a database file with a rollback journal, the data is only written once. The rollback journal records the original size of the database file and truncates the database upon rollback. So pages beyond the end of the original database file size are never journalled. Hence when extending the size of a database file, a rollback journal does less I/ O than a replay journal. D. Richard Hipp [EMAIL PROTECTED] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users