On Fri, Nov 9, 2012 at 9:22 AM, Kevin Grittner <kgrittn@mail.com> 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