Re: TRUNCATE SERIALIZABLE and frozen COPY

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: TRUNCATE SERIALIZABLE and frozen COPY
Дата
Msg-id
CA+TgmoY4D_6X7AGtYU+H54=P0r=jR-n_K=6HeyBzsFbw0TodKA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Robert Haas <robertmhaas@gmail.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Hannu Krosing <hannu@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Hannu Krosing <hannu@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Marti Raudsepp <marti@juffo.org>
Re: TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndquadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Robert Haas <robertmhaas@gmail.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndQuadrant.com>
Re: TRUNCATE SERIALIZABLE and frozen COPY Marti Raudsepp <marti@juffo.org>
Re: TRUNCATE SERIALIZABLE and frozen COPY Simon Riggs <simon@2ndQuadrant.com>
On Fri, Nov 9, 2012 at 9:22 AM, Kevin Grittner  wrote:
> (1) Any attempt to read from the truncated table would not block. The
> pg_class version included in the transaction's snapshot would
> determine which heap and indexes were accessed.

Well, the thing is, you can't actually do this.  When the transaction
commits, we truncate the main forks of the old heap and index and
remove all of the supplemental forks.  The main forks are finally
removed for good at the next checkpoint cycle.  To make this work,
we'd have to keep around the old heap and index until there were no
longer any MVCC snapshots that could see them.  That might be useful
as an option, but it would need a bunch of additional mechanism, and
it doesn't seem desirable as a default behavior because it could defer
disk space reclamation indefinitely.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Robert Haas
Дата:
FAQ