Re: I: About "Our CLUSTER implementation is pessimal" patch

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: I: About "Our CLUSTER implementation is pessimal" patch
Дата
Msg-id 1285764117-sup-6831@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: I: About "Our CLUSTER implementation is pessimal" patch  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Ответы Re: I: About "Our CLUSTER implementation is pessimal" patch  (Simon Riggs <simon@2ndQuadrant.com>)
Список pgsql-hackers
Excerpts from Itagaki Takahiro's message of mié sep 29 01:25:38 -0400 2010:

> To be exact, It's very complex.
> During reconstructing tables, it requires about twice disk space of
> the old table (for sort tapes and the new table).
> After sorting the table, CLUSTER performs REINDEX. We need
> {same size of the new table} + {twice disk space of the new indexes}.
> Also, new relations will be the same sizes of old relations if they
> have no free spaces.

Aren't the old table and indexes kept until transaction commit, though?
So during the reindex you still keep the old copy of the table and
indexes around, thus double space.  The only space difference would be
extra free space in the old table, tuples older than OldestXmin, and
fillfactor changes.

> So, I think "twice disk space of the sum of table and indexes" would be
> the simplest explanation for safe margin.

Agreed.

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


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

Предыдущее
От: Shigeru HANADA
Дата:
Сообщение: Re: patch: SQL/MED(FDW) DDL
Следующее
От: Robert Haas
Дата:
Сообщение: Re: security hook on table creation