On Mon, Aug 17, 2009 at 2:32 AM, Jeff Davis<pgsql@j-davis.com> wrote:
>
> This patch introduces a GUC vacuum_freeze_opportunistic_ratio. If one
> tuple on a page is frozen by vacuum, it effectively multiplies
> vacuum_freeze_min_age by vacuum_freeze_opportunistic_ratio and uses that
> lower (more aggressive) value only for the current page.
I thought Josh's idea to apply this opportunistic threshold if the
page is already dirty for any reason was a good idea. Ie, if some
other dml or hint bit was set since the page was loaded even if vacuum
doesn't find any tuples are freezable.
So basically I think the logic should be:
normal-vacuum-processing
if (page-is-clean) try-to-freeze(normal-threshold)
if (page-is-dirty) try-to-freeze(opportunistic-threshold)
Sure it's duplicated work but I don't think it will add up to much.
The normal pass could remember the oldest xid found and we could skip
the second pass if the oldest xid is still too young.
--
greg
http://mit.edu/~gsstark/resume.pdf