Setting vacuum_freeze_min_age really low

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Setting vacuum_freeze_min_age really low
Date: 2013-03-25 20:31:17
Message-ID: 5150B415.9060907@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Folks,

In the past, setting vacuum_freeze_min_age (vfma) really low (say to
10000 or 50000) would have caused lots of extra writing work due to
dirtying extra pages for freezing. This has been our stated reason to
keep vfma high, despite the obvious advantage of freezing tuples while
they're still in the cache.

With the visibility map, though, vfma should only be dirtying pages
which vacuum is already visiting because there's dirty tuples on the
page. That is, pages which vacuum will probably dirty anyway, freezing
or not. (This is assuming one has applied the 9.2.3 update.)

Given that, it seems like the cost of lowering vfma *should* be
marginal. The only extra work done by a lower vfma should be:

1. extra cpu time to put in the froxenXIDs on vacuumed pages, and
2. dirtying the minority of pages which vacuum decided to scan, but not
write to.

The second point is the one where I'm not sure how to evaluate. How
likely, as of 9.2, is vacuum to visit a page and not dirty it? And are
there other costs I'm not thinking of?

--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2013-03-25 20:34:24 Re: 9.2.3 upgrade reduced pgbench performance by 60%
Previous Message Greg Jaskiewicz 2013-03-25 20:08:39 Proof of concept: Evolving postgresql.conf using genetic algorithm