Freezing tuples on pages dirtied by vacuum

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Freezing tuples on pages dirtied by vacuum
Date: 2006-07-19 23:07:53
Message-ID: 20060719230753.GE83250@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-07-19 23:27:54 Re: Max size of a btree index entry
Previous Message Tom Lane 2006-07-19 23:00:40 Re: How does the planner deal with multiple possible indexes?