If the power never goes out and no programs ever crash on you system then Synchronous = OFF is for you, but the rest of the world might still want it ON. Really it sounds like the thing you need to worry about most is the unexpected termination of your program. If you aren't worried about that...
The bottom line is how important is the speed VS Data?

Your program must do a lot of data modification for you to see the kind of improvements that you sound like you are getting by turning off the Sync. Are you using transactions where you can? Transactions can speed up things quite a bit if you have more than one row of data that you are modifying at a time... personally i would try transactions to speed things up before i did something as drastic as turning off the sync.

As for detecting a corrupt database, it won't tell you on opening it that it is corrupt... it will even execute statements till it hits a piece of the db that is corrupt (at least the corruption that i have seen, which was from a bad disk, so might not be the same). There is a symptom of a corrupt database that i think is almost a sure thing.. run vacuum or dump the database from the command line tool. If these run OK then you are probably fine.

Anybody have a better way to tell if a db is garbage?

I hope i answered at least part of your question...
--Preston


From: "Dinsmore, Jeff" <[EMAIL PROTECTED]>
Reply-To: sqlite-users@sqlite.org
To: <sqlite-users@sqlite.org>
Subject: [sqlite] How dangerous is PRAGMA Synchronous OFF?
Date: Wed, 16 Nov 2005 08:49:10 -0600

I have a little engine doing HL7 messaging using SQLite3 from Tcl
(Windows Server 2003 with a local attached RAID 5 for database).

I'm looking for some speed improvements, so yesterday I experimented
with PRAGMA synchronous = OFF. Holy Cats - it's WAAAY faster - like
night and day.

So, I'd like to use synchronous = OFF, but I'd like to understand a
little more about the possible side effects.

I understand that if the OS crashes or if I lose power to the server
it's possible that the SQLite database could be corrupted assuming that
the failure happens at a time after  SQLite has handed off a database
write to the OS but before the OS has committed the write to disk.

My server is UPS'd and the server has dual power supplies, so power
should be pretty stable. The Windows OS also seems to be pretty stable
and the RAID has battery protected cache. So I'm fairly comfortable with
my OS, hardware and power reliability.

The Big Question: What evidence will I see from SQLite that a database
file is corrupt? Will it fail to open and return an error to that
effect? Or, will it (possibly) open the database and then fail somewhere
down the line when it hits the corrupted area of the database?

I have never experienced any SQLite database corruption. Does anyone
have a feel for how common database corruption is in the real world?

Thanks,

Jeff Dinsmore
IT - Interfaces
Ridgeview Medical Center
[EMAIL PROTECTED]
952.442.2191 x6592



Ridgeview Medical Center Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


Reply via email to