From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Chris Browne <cbbrowne(at)acm(dot)org> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: REINDEX DATABASE |
Date: | 2005-07-28 05:08:55 |
Message-ID: | 20367.1122527335@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Chris Browne <cbbrowne(at)acm(dot)org> writes:
> achill(at)matrix(dot)gatewaynet(dot)com (Achilleus Mantzios) writes:
>> I am just saying that the common saying "reindex is not needed for
>> 7.4+" maybe is not true in all circumstances.
> ...
> In versions earlier than 7.4, running a REINDEX periodically was
> *essential* if you had update patterns consistent with the (remarkably
> common) scenario described above.
> This reason to reindex (which was the main reason we required
> reindexing when using 7.2) has been resolved and gone away in 7.4.
> There may be other factors that could mandate REINDEX; as far as I can
> tell, the main such factor that remains would be where a table sees
> enormous numbers of updates but is not VACUUMed often enough.
I think the case that 7.4 resolved is where you have a
continually-moving window of index values; for example, an index on a
timestamp column in a table where you delete entries older than 30 days.
Before 7.4, index pages for timestamps older than 30 days would become
empty and then just sit there, with no other way to reclaim them than
REINDEX.
The case that isn't resolved yet is where you have a usage pattern that
causes a lot of index pages to become mostly but not entirely empty.
For example, your entries are timestamps, and you have a cleanup process
that removes just 99 out of every 100 successive entries. This'll leave
you with just a couple of index entries per page, which might not be
infinite bloat but it's surely not too efficient.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Achilleus Mantzios | 2005-07-28 06:32:46 | Re: REINDEX DATABASE |
Previous Message | Bruno Wolff III | 2005-07-27 20:37:59 | Re: Foreign key with check? |