-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Griggs, Donald wrote:
> The INSERT into main.table (with its associated SELECT) would still be
> an implicit transaction and of course would require writing to the
> database of the million records.
> 
> During the rather long period of time for the INSERT to complete,
> wouldn't Ian's original problem still exist (and perhaps be worse
> because of the added delays and possible disk arm contention)?

Doing what I said would result in the shortest transaction possible.  In
his original case there was computation generating rows written to the
database so you had both computation time and SQLite time.  With the
copy from a second database approach, SQLite has the opportunity to do
it as fast as possible.

You are right that it will still take time.  If the disk is capable of
writing 10MB/s and the transaction generates 50MB of data then there is
going to be a 5 second hit no matter what adding to the main database.
However if the computations take 50 seconds to generate that data then
doing it directly against the main database would keep it locked for ~55
seconds.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkmAeGMACgkQmOOfHg372QR03ACggug8qOyOo+Rqyl0HbnWik11f
mcUAn3UG7fGMujjhmKDp0BxeBu5M4Pig
=wbNc
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to