From: Tom Lane <tgl@sss.pgh.pa.us>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Deleting indexes before vacuum?
Date: Sun, 21 Nov 1999 22:18:24 -0500
Message-ID: <20832.943240704@sss.pgh.pa.us> (raw)
In-Reply-To: <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp>
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
>> I have been toying with the notion of ripping out the existing VACUUM
>> index handling code and putting in fresh code that would simply do an
>> index drop and rebuild ;-).
> Shouldn't vacuum preserve consistency even in case of abort ?
That would be nice, certainly, but the existing code doesn't guarantee
it either, and I don't see how we could guarantee it by any method.
If you're moving tuples around then you are going to have some
inconsistent intermediate states :-(. However, the big problem in
that respect is an abort while vacuum is reshuffling the data in the
table itself; changing our approach to index vacuuming isn't going
to make any difference there. Once the table is finished and vacuum
moves on to fixing the indexes, an abort would leave the index(es)
corrupt but the table data should be OK. So the issue is how to
recover the indexes after that happens.
> Rebuiding indexes in vacuum has a big flaw that index may vanish in
> case of abort and we may have to recreate index manually.
The index won't "vanish" --- I see no reason to touch the system-table
entries for it. The data in the index might be corrupt, but that can
happen now.
ISTM that a big advantage of the rebuild approach is that if something
does go wrong during the index-fixing phase, you can try to recover just
by doing another vacuum. That strikes me as less "manual" than dropping
and rebuilding the indexes, which is the only available recovery path
now. It might even work for an index on a system table...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, Inoue@tpf.co.jp
Subject: Re: [SQL] Deleting indexes before vacuum?
In-Reply-To: <20832.943240704@sss.pgh.pa.us>
References: <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp> <20832.943240704@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox