Skip site navigation (1) Skip section navigation (2)

Re: [GENERAL] Odd VACUUM behavior when it is expected to truncate last empty pages

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Subject: Re: [GENERAL] Odd VACUUM behavior when it is expected to truncate last empty pages
Date: 2011-08-03 21:10:53
Message-ID: CABOikdNxP+ZrhqaHwdW8nV37be+WoPkbXeHCfhHkrgir+eT1Fg@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
On Wed, Aug 3, 2011 at 12:33 PM, Pavan Deolasee
<pavan(dot)deolasee(at)gmail(dot)com> wrote:
>
>
> The only problem, other than a surprising behavior that you noted,
> that I see with this approach is that we might repeatedly try to
> truncate a relation which in fact does not have anything to truncate.
> The worst  thing is we might unnecessarily take an exclusive lock on
> the table.
>

So it seems we tried to fix this issue sometime back
http://archives.postgresql.org/pgsql-hackers/2008-12/msg01994.php

But I don't quite understand how the fix would really work.
nonempty_pages would most likely be set at a value lower than relpages
if the last page in the relation is all-visible according to the
visibility map. Did we mean to test (nonempty_pages > 0) there ? But
even that may not work except for the case when there are no dead
tuples in the relation.

Thanks,
Pavan

-- 
Pavan Deolasee
EnterpriseDB     http://www.enterprisedb.com

In response to

Responses

pgsql-hackers by date

Next:From: James RobinsonDate: 2011-08-03 21:19:15
Subject: Postgres / plpgsql equivalent to python's getattr() ?
Previous:From: Robert HaasDate: 2011-08-03 21:04:56
Subject: Re: mosbench revisited

pgsql-general by date

Next:From: Earth AnalizerDate: 2011-08-04 05:03:48
Subject: How to get last Error Message/Code
Previous:From: Terry Lee TuckerDate: 2011-08-03 20:29:50
Subject: Re: running out of oids

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group