Re: : Performance Improvement Strategy

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: : Performance Improvement Strategy
Дата
Msg-id 4E79E97D0200002500041570@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: : Performance Improvement Strategy  (Venkat Balaji <venkat.balaji@verse.in>)
Ответы Re: : Performance Improvement Strategy  (Venkat Balaji <venkat.balaji@verse.in>)
Список pgsql-performance
Venkat Balaji <venkat.balaji@verse.in> wrote:

> If i got it correct, CLUSTER would do the same what VACUUM FULL
> does (except being fast)

CLUSTER copies the table (in the sequence of the specified index) to
a new set of files, builds fresh indexes, and then replaces the
original set of files with the new ones.  So you do need room on
disk for a second copy of the table, but it tends to be much faster
then VACUUM FULL in PostgreSQL versions before 9.0.  (Starting in
9.0, VACUUM FULL does the same thing as CLUSTER except that it scans
the table data rather than using an index.)  REINDEX is not needed
when using CLUSTER or 9.x VACUUM FULL.  Older versions of VACUUM
FULL would tend to bloat indexes, so a REINDEX after VACUUM FULL was
generally a good idea.

When choosing an index for CLUSTER, pick one on which you often
search for a *range* of rows, if possible.  Like a name column if
you do a lot of name searches.

-Kevin

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

Предыдущее
От: Venkat Balaji
Дата:
Сообщение: Re: : Performance Improvement Strategy
Следующее
От: Royce Ausburn
Дата:
Сообщение: Re: Prepared statements and suboptimal plans