pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hiroshi Inoue <Inoue@tpf.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: Oleg Bartunov <oleg@sai.msu.su>
Cc: Matthew Hagerty <matthew@venux.net>
Cc: pgsql-sql@postgreSQL.org
Subject: RE: [SQL] Deleting indexes before vacuum?
Date: Mon, 22 Nov 1999 10:53:28 +0900
Message-ID: <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp> (raw)
In-Reply-To: <7175.943117272@sss.pgh.pa.us>

> -----Original Message-----
> From: owner-pgsql-sql@postgreSQL.org [mailto:owner-pgsql-sql@postgreSQL.
> org]On Behalf Of Tom Lane
> Sent: Sunday, November 21, 1999 2:01 AM
> To: Oleg Bartunov
> Cc: Matthew Hagerty; pgsql-sql@postgreSQL.org
> Subject: Re: [SQL] Deleting indexes before vacuum?
>
>
> Oleg Bartunov <oleg@sai.msu.su> writes:
> > The question is: what's the right way to do drop index/vacuum/create ?
> > Do I need transaction ?
>
> VACUUM should not be run inside a transaction block.  (I am planning to
> make the code enforce this for 7.0, but it doesn't yet.)  So you can't
> protect the whole sequence with a transaction.  AFAICS the only real
> problem is that if you are depending on UNIQUE indexes to catch
> attempts to insert duplicate data, an insertion that got in between
> the drop and recreate wouldn't get checked.
>
> 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 ;-).  This could happen inside VACUUM's exclusive
> lock on the table, so it'd be perfectly safe whereas doing it the manual
> way is not.  But I do not want to do this unless Vadim approves it as a
> good idea --- perhaps the existing index-vacuuming code can be fixed to
> be an even better solution than this.  I haven't looked at the code to
> understand why it's so slow or whether there's a way to make it better.
>

Shouldn't vacuum preserve consistency even in case of abort ?
Currently PostgreSQL doesn't do little in case of abort(even commit also ?).
So I think it's a strong limitation.

It's well known that rebuilding indexes is faster than insert/deleting
many index tuples.
I have thought rebuilding indexes in vacuum for half a year.
But I don't have a reasonable solution yet.

Rebuiding indexes in vacuum has a big flaw that index may vanish in
case of abort and we may have to recreate index manually.

Regards.

Hiroshi Inoue
Inoue@tpf.co.jp




view thread (10+ messages)  latest in thread

Message-ID: <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp>
Permalink:  ../000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp/
Also on:    postgresql.org/message-id/000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp

 · 

reply

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: Inoue@tpf.co.jp, tgl@sss.pgh.pa.us, oleg@sai.msu.su, matthew@venux.net
  Subject: Re: [SQL] Deleting indexes before vacuum?
  In-Reply-To: <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp>
  References: <7175.943117272@sss.pgh.pa.us> <000001bf348c$5f35f260$2801007e@cadzone.tpf.co.jp>

* 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