Re: Remove xmin and cmin from frozen tuples - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove xmin and cmin from frozen tuples
Date
Msg-id 12117.1125580955@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove xmin and cmin from frozen tuples  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Responses Additional background daemon (was: Remove xmin and cmin from frozen tuples)
Re: Remove xmin and cmin from frozen tuples
List pgsql-hackers
ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp> writes:
> I agree. I think an good position of freezer is on bgwriter.
> My idea is:
>   1. Just before bgwriter writes an dirty page in LRU order,
>   2. Freeze tuples in the page and repair fragmentation.
>   3. (Replace the fsm page that has least freespace.)
>   4. Flush the page.

This is a bad idea.  The bgwriter isn't the place to be doing freezing,
because there is no reasonable way for it to guarantee that all old
tuples in a table (or any larger unit) have been frozen.  So you'd still
need VACUUM to ensure no wraparound.  Plus, you can't do such changes
without emitting an XLOG record, which is something we don't want
happening in the bgwriter's inner loop.  Even more to the point, you
can't do such changes without getting a superexclusive lock on the page
(not only locked, but no one else has it pinned), which is a real
nonstarter for the bgwriter, both for performance and possible deadlock
issues.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: broken configure, broken makefile?
Next
From: "Zeugswetter Andreas DAZ SD"
Date:
Subject: Re: Pre-allocated free space for row