views:

329

answers:

1

I am (still) working on an iPhone program which uses SQLite3. I have managed to optimize the database writes as far as I can.

The problem I have now is that "END TRANSACTION" is killing me as it's taking very long. The journal file is usually about 50k which might be a problem, but I'd like to know your ideas.

I tried using "PRAGMA synchronous = 0", but that caused some data corruption. My latest attempt at optimizing is "PRAGMA journal_mode=TRUNCATE" but I do not know if that helps a lot.

Any suggestions at this stage?

+2  A: 

Have you tried the in memory journaling?

"PRAGMA journal_mode=MEMORY"

That was one of the most significant performance boosts for us.

If that is not quite fast enough yet, try the memsys5 stuff. http://www.sqlite.org/compile.html#enable%5Fmemsys5

JDM
I've added that and seeing how it works. So far it has been very fast.Thanks.
John Smith