On Thu, 17 Nov 2005 [EMAIL PROTECTED] wrote:

>
>>
>> Database corruption is uncommon.  The usual causes are
>>
>>   (1) Running with synchronous=OFF
>
>Which just about sums it up!
>
>But, a question, I assume there is no risk if you are only using
>selects, i.e. the db is read only. Is there any performance advantage
>in having synchronous off in these circumstances? I suspect not.
>
>I have in mind another scenario, that of bulk inserts to a newly created
>table. Would it be viable and safe to:
>
>PPRAGMA synchronous=OFF
>Create table (with no indices)
>Insert ad nauseum
>PPRAGMA synchronous=FULL
>Create Index....


No more safe than the rest of the discussion. Plus, all you need to do is
wrap the lot in a transaction, and you'll only have synchronous IO when
updating the rollback journal and when closing the transaction. As many
row inserts can be aggregated into single journal updates, and journal
updates will only happen when you spill data from the cache, small to
medium bulk inserts should only incur the final closing synchronous IO
when committing the transaction.

Christian

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

Reply via email to