Thank you very much, your explanation helped a lot.

This is the tool I needed the solution for if you are interested.

On 4 August 2011 01:10, Pavan Deolasee <> wrote:
> On Wed, Aug 3, 2011 at 12:33 PM, Pavan Deolasee
> <> 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
> 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

Sergey Konoplev

Blog: /
Linkedin: /
JID/GTalk: / Skype: gray-hemp

Sent via pgsql-hackers mailing list (
To make changes to your subscription:

Reply via email to