Igor Tandetnik <itandetnik-fh9draxc...@public.gmane.org> writes: > On 4/5/2011 10:01 PM, Nikolaus Rath wrote: >> I'm experimenting with creation of a 156 MB database from scratch. I've >> set synchronous = NORMAL and locking_mode = exlusive. >> >> With journal_mode = off and without wrapping the INSERTs into a >> transaction, creating the db takes 54 seconds. >> >> With journal_mode = WAL (and still no transaction), it takes an >> impressive 900 seconds. >> >> With journal_mode = WAL and the INSERTs packed into a transaction, the >> total time is 60 seconds. >> >> I am slightly surprised by this. I was expecting that the difference >> between transaction/no transaction with WAL is just the writing of an >> additional few bytes of commit marker into the WAL file with every >> insert. But apparently something much more time consuming is happening >> as well. > > Committing a transaction involves waiting until the data is physically > transferred to the disk surface (as opposed to sitting in OS buffers).
My understanding was that with WAL and synchronous = NORMAL, only checkpointing waits for the data to physically arrive on the disk, and committing a transaction happily continues once the data has been handed to the OS. Am I wrong? > This requires at least two complete revolutions of the disk platter. > With an above-average hard drive running at 15000 RPM, you can have a > throughput of 125 transactions per second, at best. How many rows are > you inserting? About 2 million. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users