Re: Problem with corrupt index - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Problem with corrupt index
Date
Msg-id 20020930174932.GA26748@atentus.com
Whole thread Raw
In response to Problem with corrupt index  (Diogo Biazus <diogo@ikono.com.br>)
Responses Re: Problem with corrupt index  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Sep 30, 2002 at 02:41:16PM -0300, Diogo Biazus wrote:
> Hi everybody,
> I have a table that requires periodical updates (every 5 seconds) in
> more than one register.
> The table is very small (about 7 registers) and it wont grow.
> Sometimes the access to that table becomes very slow, and VACUUM dont
> fix it, I have to REINDEX the table.

Do you have an incrementing field in the table, and index it?  If so,
your problem is that the index doesn't drop empty pages or mark them as
free, and updating it will make the index bigger; the only way to
reclaim space is by means of recreating the index.

If you only have 7 registers in the table, you don't need the index
anyway: a sequential scan is much faster.  My advice would be to drop
the index.  If you have a primary key you can't do that, and you'll have
to continue doing REINDEX and VACUUM periodically.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"La virtud es el justo medio entre dos defectos" (Aristoteles)

pgsql-general by date:

Previous
From: Doug McNaught
Date:
Subject: Re: Problem with corrupt index
Next
From: Tom Lane
Date:
Subject: Re: [SQL] CURRENT_TIMESTAMP