| From: | John A Meinel <john(at)arbash-meinel(dot)com> |
|---|---|
| To: | Yves Vindevogel <yves(dot)vindevogel(at)implements(dot)be> |
| Cc: | pgsql-performance(at)postgresql(dot)org |
| Subject: | Re: Another question on indexes (drop and recreate) |
| Date: | 2005-06-21 15:49:28 |
| Message-ID: | 42B83708.2050706@arbash-meinel.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
=:->
| From | Date | Subject | |
|---|---|---|---|
| Next Message | William Yu | 2005-06-21 16:04:48 | Trying to figure out pgbench |
| Previous Message | Amit V Shah | 2005-06-21 15:46:59 | Re: Do Views execute underlying query everytime ?? |