Re: Vacuum (table performance)

From: Jason Earl <jason(dot)earl(at)simplot(dot)com>
To: "Claudio Lapidus" <clapidus(at)hotmail(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-general(at)postgresql(dot)org
Subject: Re: Vacuum (table performance)
Date: 2003-06-26 00:25:44
Message-ID: 87of0ln0qf.fsf@npa01zz001.simplot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Claudio Lapidus" <clapidus(at)hotmail(dot)com> writes:

> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>>
>>"Claudio Lapidus" <clapidus(at)hotmail(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message MT 2003-06-26 00:29:26 Re: selecting the record before the last one
Previous Message Claudio Lapidus 2003-06-26 00:01:51 Re: Vacuum (table performance)