> -----Original Message----- > From: Nono BEZMan [mailto:[EMAIL PROTECTED] > > Why not integrate a patch like this one > (http://www.sqlite.org/cvstrac/tktview?tn=1250) in the > next cvs. It would awesome for us windows users to be > able to chose between FILE_FLAG_WRITE_THROUGH and > FlushFileBuffers, with a PRAGMA for instance! > > I did make the changes in the pacth using 3.3.2 as > base (I had to change a few function names + change > the 'id->' in to 'f.' + did not like '@@ -169,6 +192,7 > @@ (..) + id->writeThru = 0;' so I did apply that > change). > > Anyways, I went with this solution after experiencing > extremely slow performance doing multiple simple > insterts. I know about the Synchronous=OFF (which > works wonders as far as performance), as well as using > transactions (which also works great, except that I > have multiple processes using the same database and > inserting/updating stuff atomically). > > Here's the pseudo-code that I used: > > - 'CREATE TABLE Test (TestID INTEGER PRIMARY KEY, > TestValue INTEGER);' > - Do N x 'INSERT INTO Test (TestValue) VALUES (1)';
The critical thing missing from the above pseudo code is the transaction being started before the loop and committed afterwards. Inside a transaction, you can easily get 100,000 inserts/sec in SQLite with Synchronous=Normal Robert