On Tue, 4 Oct 2005, Martin Engelschalk wrote:

>Hello Christian,
>
>thank you, but synchronous is already off. What i aim to avoid is
>writing the rollback - journal. In order to rollback, some additional
>writing to disk is surely unaviodable.


You'll have to write your own pager layer, as there is currently no way to
disable the rollback journal.

Note, with no rollback journal, you'll not be able to rollback a
transaction. Any updates you make will be final even before a commit.

Another option might be to use a memory database, and write periodic
snapshots to disk in the form of a SQL text file. Look at shell.c in the
SQLite source for an example of how to do this (look for implementation of
the .dump command.) The SQL file then becomes your checkpoint, and can
also be compressed quite nicely which may save disk space. This is how the
likes of HSQL works.

Of course, if this is an embedded application, memory may be a problem
with a memory database. YMMV.


>
>Martin
>
>Christian Smith schrieb:
>
>>On Tue, 4 Oct 2005, Martin Engelschalk wrote:
>>
>>
>>
>>>Hi all,
>>>
>>>it may sound strange, but I do not need transactions.  Also i do not
>>>care if the database is corrupted in case of a program or system crash.
>>>So: is it possible to disable transactions in sqlite? Mr. Mark Allan
>>>seems to have done this. Could i speed up my writes this way?
>>>
>>>
>>
>>
>>Turn off synchronous writes:
>>http://www.sqlite.org/pragma.html
>>
>>Look for the synchronous pragma. Set it to OFF:
>>sqlite> PRAGMA synchronous = OFF;
>>
>>Updates to transactions will no longer fsync() data to the disk, and
>>instead rely on OS write-back caching, which can significantly improve
>>speed at the cost of chances of corruption in case of system crash.
>>
>>
>>
>>
>>>Thanks,
>>>Martin
>>>
>>>
>>>
>>
>>
>>
>

-- 
    /"\
    \ /    ASCII RIBBON CAMPAIGN - AGAINST HTML MAIL
     X                           - AGAINST MS ATTACHMENTS
    / \

Reply via email to