On Tue, Sep 15, 2009 at 8:11 PM, Tito Ciuro <tci...@mac.com> wrote:
> On Sep 15, 2009, at 8:04 PM, Scott Hess wrote:
>> Do you have any reason to believe that your database had exactly a
>> single corruption?
>
> What do you mean by 'single corruption'? This particular database is
> prone to index corruption. We just don't know why yet. Why I reported
> is what I obtain by running pragma integrity_check. I don't know how
> else to look for additional corruption.

What I mean is that SQLite can't do better than the underlying system
can provide.  So unless you have a strong reason to believe that there
is only a single bit of corruption involved, you should probably
assume that the database is corrupt in more ways than you realize.
PRAGMA integrity_check can provide definite evidence of corruption,
but just because it says that the index is corrupt doesn't mean that
the table is _not_ corrupt.

>> My experience is that once you've found one bit of corrupt data, it's
>> highly likely that you'll find others.  Earlier, you said your index
>> was corrupt.  The index is how SQLite enforces things like primary key
>> uniqueness, so if your index is corrupt, you can lose that uniqueness
>> guarantee.
>
> I understand, but this begs the question: how does the index get
> corrupted in the first place? Is there a known reason? If I know where
> to look, perhaps I could find the culprit.

http://www.sqlite.org/atomiccommit.html , especially the section about
"Things that can go wrong".  To a great degree, figuring out how
something becomes corrupt can be a really big problem.  For the most
part, SQLite arranges things so that so long as your OS doesn't crash,
things are recoverable without corruption, and SQLite is pretty good
at what it does.  For the most part, the instances of corruption I've
seen seem to relate to things like losing power when there's unwritten
data in the disk cache (deploy to enough laptops and this will simply
happen).

-scott
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to