Henning,
Since enclosing your inserts in a transaction (see below) would likely
result in a *HUGE* increase in speed, might this remove your need for a
:memory: database altogether?
BEGIN;
INSERT...;
INSERT...;
...
COMMIT;
(In addition to using a transaction, you can also play with the page size,
delay index creation until after the inserts, etc.)
If, for some reason, using a transaction is truly impossible, you can turn
off synchronous mode within sqlite until your inserts are complete. This
should also give you a very large increase in speed -- and I would guess
it's no more risky that using :memory:.
If you nonetheless still need a :memory: database, could you explain further
about why the ATTACH method seems cumbersome? It would only take a few
statements to copy your table to disk, right?
If your question still persists in the form of, "Is there a one-call method
in the API to write out any :memory: database to disk?", then I think the
answer is, "No, if ATTACH is too cumbersome, you would need to write your
own code as you see fit."
Donald Griggs
Opinions are not necessarily those of Misys Healthcare Systems nor its board
of directors.
-----Original Message-----
From: Henning Friese [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 11, 2006 3:51 AM
To: [email protected]
Subject: Re: [sqlite] Dumping Memory-DB to File
Joe Wilson wrote:
>
> :memory: is faster if you're not using transactions.
>
Hello Joe,
thanks for your answer. I'm not using transactions, I'm just doing a lot of
"INSERT INTO"s with a huge amount of data. It seems to be faster doing that
in a ":memory:"-db (I've already tried that). I just need to write that db
to a file. What's the best way to archive this?
Best regards,
Henning
--
View this message in context:
http://www.nabble.com/Dumping-Memory-DB-to-File-t1592559.html#a4336127
Sent from the SQLite forum at Nabble.com.