Re: REINDEX DATABASE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: REINDEX DATABASE
Дата
Msg-id 20367.1122527335@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: REINDEX DATABASE  (Chris Browne <cbbrowne@acm.org>)
Список pgsql-sql
Chris Browne <cbbrowne@acm.org> writes:
> achill@matrix.gatewaynet.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


В списке pgsql-sql по дате отправления:

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Foreign key with check?
Следующее
От: Achilleus Mantzios
Дата:
Сообщение: Re: REINDEX DATABASE