Re: How often do I need to reindex tables?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How often do I need to reindex tables?
Дата
Msg-id 16824.1172871578@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How often do I need to reindex tables?  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: How often do I need to reindex tables?  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-general
Jeff Davis <pgsql@j-davis.com> writes:
> Isn't a REINDEX still needed in the case of monotonically increasing
> keys, such as in a sequence or timestamp index? I also delete tuples, so
> that results in a forward-shifting range of keys.

No, that shouldn't be a problem, if you're maintaining a constant key
range width (that is, *all* the old entries get deleted).  The only
pattern I'm aware of that causes a problem is if you leave a small
subset of the keys behind, for instance insert every few minutes and
then later delete all but one entry per day.  In this situation you may
end up with an index containing as few as one entry per page.  We
don't have any mechanism short of REINDEX to collapse nonempty index
pages together, so that way lies bloat.  But if you delete all the old
entries then the pages get recycled and there shouldn't be a problem.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Large aggregate query running out of memory in ExecutorState
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: [HACKERS] WITH/RECURSIVE plans