]> granicus.if.org Git - postgresql/commitdiff
Fix typo in freeze_table_age implementation
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 1 Feb 2013 15:00:40 +0000 (12:00 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 1 Feb 2013 15:10:10 +0000 (12:10 -0300)
The original code used freeze_min_age instead of freeze_table_age.  The
main consequence of this mistake is that lowering freeze_min_age would
cause full-table scans to occur much more frequently, which causes
serious issues because the number of writes required is much larger.
That feature (freeze_min_age) is supposed to affect only how soon tuples
are frozen; some pages should still be skipped due to the visibility
map.

Backpatch to 8.4, where the freeze_table_age feature was introduced.

Report and patch from Andres Freund

src/backend/commands/vacuum.c

index 9b5b79fdcc52d5568c70f681846c3ae52df2bb97..656b90eed36fe4d151c4f2ed1832e5df9284e080 100644 (file)
@@ -446,7 +446,7 @@ vacuum_set_xid_limits(int freeze_min_age,
                 * VACUUM schedule, the nightly VACUUM gets a chance to freeze tuples
                 * before anti-wraparound autovacuum is launched.
                 */
-               freezetable = freeze_min_age;
+               freezetable = freeze_table_age;
                if (freezetable < 0)
                        freezetable = vacuum_freeze_table_age;
                freezetable = Min(freezetable, autovacuum_freeze_max_age * 0.95);