Re: Another question on indexes (drop and recreate) - Mailing list pgsql-performance

From John A Meinel
Subject Re: Another question on indexes (drop and recreate)
Date
Msg-id 42B83708.2050706@arbash-meinel.com
Whole thread Raw
In response to Re: Another question on indexes (drop and recreate)  (Yves Vindevogel <yves.vindevogel@implements.be>)
Responses Re: Another question on indexes (drop and recreate)
List pgsql-performance
Yves Vindevogel wrote:

> And, after let's say a week, would that index still be optimal or
> would it be a good idea to drop it in the weekend and recreate it.


It depends a little bit on the postgres version you are using. If you
are only ever adding to the table, and you are not updating it or
deleting from it, I think the index is always optimal.
Once you start deleting from it there are a few cases where older
versions would not properly re-use the empty entries, requiring a
REINDEX. (Deleting low numbers and always adding high numbers was one of
the cases)

However, I believe that as long as you vacuum often enough, so that the
system knows where the unused entries are, you don't ever have to drop
and re-create the index.

John
=:->


Attachment

pgsql-performance by date:

Previous
From: Amit V Shah
Date:
Subject: Re: Do Views execute underlying query everytime ??
Next
From: William Yu
Date:
Subject: Trying to figure out pgbench