Clay Dowling wrote:
Edovia Technologies said:
It works, although it takes quite a while to transfer data. Like about a
minute for 500 records!

Wrap each table into a transaction. You'll be shocked at how much faster it is. I have a similar application to transfer a 2.5 MB paradox database. It took hours before I added the transaction, and minutes after.


Steven Van Ingelgem wrote:
How can I make sure after an insert that everything has been flushed to disc?


SQLite flushes everything to the disk whenever it COMMITs and a COMMIT is implied after each INSERT unless you explicitly start a multi-statement transaction using BEGIN.

Flushing to the disk is slow.  It normally takes about 2 complete
revolutions of the disk platter to complete the flush.  On a 7200RPM
disk drive, that comes to 1/60th of a second.  Consequently, you are
hardward limited to about 60 COMMITs per second.

That's why it take so long to do a bunch of INSERTs that are not
inside a transaction.  After each INSERT, SQLite has to wait for
the disk flush to complete which takes about 1/60th of a second.
On the other hand, if you put all the INSERTs inside BEGIN...COMMIT,
no waiting has to occur until the final COMMIT.  This can speed up
your inserts by 2 or 3 orders of magnitude - literally.

--
D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565



Reply via email to