Freezing tuples on pages dirtied by vacuum - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Freezing tuples on pages dirtied by vacuum
Date
Msg-id 20060719230753.GE83250@pervasive.com
Whole thread Raw
Responses Re: Freezing tuples on pages dirtied by vacuum  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Currently, the loop in vacuumlazy.c that scans through the tuples on a
page checks each tuple to see if it needs to be frozen (is it's Xmin
older than half-way to wrap-around).

ISTM that as soon as vacuum dirties a page, it might as well update all
tuples it can (any where Xmin < GetOldestXmin()), since that won't take
much time compared to the cost of writing the page out. This would help
prevent the need to dirty the page in the distant future for no reason
other than to freeze tuples. Granted, the old code/checks would still
have to stay in place to ensure that tuples were vacuumed before they
got too old, but that's not much overhead compared to writing the page
to disk.

Comments? If people think this is a good idea I should be able to come
up with a patch.
-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: How does the planner deal with multiple possible indexes?
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Max size of a btree index entry