Re: index question..

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: index question..
Дата
Msg-id 23812.1037210966@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: index question..  ("Williams, Travis L, NPONS" <tlw@att.com>)
Список pgsql-general
"Williams, Travis L, NPONS" <tlw@att.com> writes:
> I thought reindexing was only to be used on corrupt tables.. will
> vacumming fix the problem?

Scott's being unnecessarily vague about the index bloat problem.
The issue is quite simple and easily understood: vacuuming does delete
dead index entries, but it does not collapse out entire unused pages in
indexes.  So (a) an index can never get smaller, even if you delete many
entries; (b) if the range of index entries changes over time, the index
will grow.  For instance, if you're indexing a timestamp column, the
right end of the btree will constantly get expanded as the maximum
column value increases.  But there's no mechanism to make the portion of
the index that covers your original oldest timestamp go away, even if
the entry itself has gone away.

Reindexing fixes this by constructing a whole new index from scratch.

We'd like plain vacuum to remove empty pages too, but doing so without
locking out concurrent accesses to the index is a tricky problem.
Perhaps it will get fixed in 7.4 ...

            regards, tom lane

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

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: index question..
Следующее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: news.postgresql.org outage