Hello,
v t <[EMAIL PROTECTED]>
27/10/2003 05:16 PM
To: "Mrs. Brisby" <[EMAIL PROTECTED]>
cc: sqlite <[EMAIL PROTECTED]>
Subject:Re: [sqlite] Journalling
> I am trying to use sqlite in a context where I will be using it to store
some configuration about a system. I want to try to minimize the disk
access. Since journalling uses a file on the disk, I wanted to turn it
off. I am not worried about rolling back the database to a known state in
case of some failure.
You're not worried about your database becoming corrupted and all your
data being destroyed? It doesn't sound like you like your data very
much... ;)
This is a question that pops up on the list every so often, and there have
been some good reasons for it. Well. One comes to mind, and that's the use
of flash memory in embedded devices. When you don't want to write to your
media too many times you might find that it's better to turn off
journalling and risk the consequences... perhaps make regular backups...
rather than write to the media too often.
The problem is that most people don't know what they're talking about when
they ask how to turn journalling off. They don't understand when the
journal gets written in the first place and they don't understand which
operations they're performing that aren't affected by journalling. They
haven't read the list archives, and they patently haven't read the manual,
because it's listed under the pragma section of
http://www.sqlite.org/lang.html.
This is why when you ask the question on this list you get the response
"Well I know you've asked how to turn off journalling, but what do you
actually want to achieve by this and what alternatives have you
considered?"
You haven't yet given an explination that makes sense to me, so in the
spirit of RTFM I'll leave you to find the exact manual reference yourself.
I think it's worth you understanding, though, that journalling doesn't
occur when you're only querying the database. It only happens when you
modify the database. Using transactions while modifying the database is
not only a good idea for data integrity, it also makes the overhead
associated with synching the file to disk almost disappear so there's
usually no need at all to turn off journalling. Given all of this, if you
still can't find the exact spot in the manuals to turn this off yourself
perhaps you could offer a more complete discussion about the nature of
your database and your access to it. You'd be well advised to discuss the
alternatives you have considered so that the gentle list members will feel
more compelled to answer your question directly.
Benjamin
--Premature optimisation is the root of all evil