Re: Index bloat of 4x

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
Cc: Jeremy Haile <jhaile(at)fastmail(dot)fm>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Ed L(dot)" <pgsql(at)bluepolka(dot)net>, Postgres general mailing list <pgsql-general(at)postgresql(dot)org>, Bill Moran <wmoran(at)collaborativefusion(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Subject: Re: Index bloat of 4x
Date: 2007-01-31 03:18:32
Message-ID: 200701310318.l0V3IWU08970@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Added to TODO:

* Add REINDEX CONCURRENTLY, like CREATE INDEX CONCURRENTLY

This is difficult because you must upgrade to an exclusive table lock
to replace the existing index file. CREATE INDEX CONCURRENTLY does not
have this complication. This would allow index compaction without
downtime.

I understand the problems, but the need for this seems pretty clear.

---------------------------------------------------------------------------

Csaba Nagy wrote:
> On Fri, 2007-01-19 at 20:03, Jeremy Haile wrote:
> > Is it feasible to add a "reindex concurrently" that doesn't lock the
> > table for the rebuild, then locks the table when doing a second pass to
> > pickup rows that were changed after the first pass? Or something like
> > that....
>
> IIRC, the objection was the deadlock potential of any lock upgrade, and
> the problems of impossible cleanup on failure if something changed the
> permissions of the executing user in the meantime. That's why I think it
> would make sense if it could be done by a privileged background thread
> like the autovacuum ones, so the lock upgrade can be tried without
> blocking, as it can take quite some time till it succeeds, and the
> cleanup is possible due to the privileged nature of the executor.
>
> If there would be such a facility it would also need some policies to
> control time windows and priorities just as for autovacuum, that's why I
> connect it in my usage-focused mind to autovacuum.
>
> Cheers,
> Csaba.
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match

--
Bruce Momjian bruce(at)momjian(dot)us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-01-31 04:08:58 Re: VACUUM and open transactions
Previous Message Joshua D. Drake 2007-01-31 02:56:32 Re: Any Plans for cross database queries on the same server?