Re: Vacuum (table performance) - Mailing list pgsql-general

From Jason Earl
Subject Re: Vacuum (table performance)
Date
Msg-id 87of0ln0qf.fsf@npa01zz001.simplot.com
Whole thread Raw
In response to Re: Vacuum (table performance)  ("Claudio Lapidus" <clapidus@hotmail.com>)
List pgsql-general
"Claudio Lapidus" <clapidus@hotmail.com> writes:

> Tom Lane <tgl@sss.pgh.pa.us> writes:
>>
>>"Claudio Lapidus" <clapidus@hotmail.com> writes:
>> > ... we are seeing increasing execution times, not for the
>> > function but for the vacuum itself.
>>
>>Does a REINDEX of the table fix it?
>>
>
> Hmm, I'm looking at the documentation and it says that REINDEX
> acquires an exclusive lock on the table. Does this mean that during
> the reindex operation the table is unavailable for read/write by other
> processes?
>
> An alternative suggested right there is to drop and recreate an index,
> where -it says- CREATE INDEX would get a write lock on the table. Does
> this mean that during the create index operation the whole table is
> unavailable for write by other processes?
>
> thanks again
> cl.

At the very least you are going to need a write lock with the existing
implementation of PostgreSQL.  Unfortunately, indexes with the current
version of PostgreSQL grow and grow indefinitely.  Tables with a lot
of turnover are especially problematic.  However, with the new release
that will be entering beta "real soon now" this will no longer be the
case.  Tom Lane has fixed the indexing code so that a vacuum will
clean out the index as well as the tablespace.

My guess is that Mr. Lane is fishing for a little bit of "beta
testing" :).

Jason

pgsql-general by date:

Previous
From: MT
Date:
Subject: Re: selecting the record before the last one
Next
From: MT
Date:
Subject: How many fields in a table are too many