Re: Set visibility map bit after HOT prune

From: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Set visibility map bit after HOT prune
Date: 2012-12-20 17:49:27
Message-ID: CABOikdPGnsWO6W3Px9GKtVByHQY9QrRVX2kGVx00ZCObMXJhYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 20, 2012 at 10:55 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com> writes:
>> Ok. Will try to read archives to see what was actually suggested and
>> why it was put on back burner. BTW at the risk of being shot down
>> again, I wonder if can we push down the freeze operation to HOT prune
>> also.
>
> Seems unlikely to be a win. We only care about freezing tuples in the
> context of being able to advance a relation-wide relfrozenxid horizon.
> Freezing pages retail accomplishes nothing whatsoever towards that goal,
> unless you have some way to know that no new freeze work will be needed
> on the page before the next vacuum freeze happens. Otherwise, you're
> just moving portions of the work from background vacuuming into
> foreground processes, with no benefit gained thereby.

If we can establish an invariant that a all-visible page is always
fully freezed, then vacuum freeze does not need to look at those pages
again. Another advantage is that we are holding the right lock and
piggyback freeze with cleanup WAL-logging, thus avoiding re-dirtying
of the page and additional WAL logging.

> In fact, you
> might well be *creating* work that would otherwise not have had to be
> done at all --- the tuple might get deleted before the next freeze
> happens.
>

Yeah, there will be cases where it might not add any value or even add
little overhead. Don't know what will serve better on an average or
majority of the workloads though. Vacuum freeze has known to add
sudden and unexpected load on the system, so I thought this might
mitigate that to a certain extent.

Thanks,
Pavan

--
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavan Deolasee 2012-12-20 18:00:35 Re: Set visibility map bit after HOT prune
Previous Message Heikki Linnakangas 2012-12-20 17:45:21 Re: ThisTimeLineID in checkpointer and bgwriter processes