-----Original Message-----
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roger Binns
Sent: Wednesday, January 28, 2009 1:12 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Transaction behavior with large numbers of inserts

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

Ian Frosst wrote:
> My question is; am I assessing the situation correctly, and if so, is 
> there anything I can do to avoid this rather nasty situation?  I would

> rather not take the periodic-commit approach, and increasing the page 
> cache size would potentially cause the use of more memory than I can 
> spare.  Disk usage, however, is not a problem; I can use as much as is
necessary.
====
You can open a second connection and make another database that you do
all your writing to, using as small a page cache as you want.  When done
add the data in your first connection.  Basically do this ("main" is the
name of the first database):

  attach second.db as second
  insert into main.table (select * from second.table)
  detach second

Roger
===============================

Roger, I am probably missing something obvious here, but I was confused.

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)?

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to