Re: Avoiding unnecessary clog lookups while freezing - Mailing list pgsql-hackers

From Peter Geoghegan
Subject Re: Avoiding unnecessary clog lookups while freezing
Date
Msg-id CAH2-Wznyx4x4OoJVeztmMh3iiSEU=xQXmP593Q8qKUR-289-qA@mail.gmail.com
Whole thread Raw
In response to Re: Avoiding unnecessary clog lookups while freezing  (Andres Freund <andres@anarazel.de>)
Responses Re: Avoiding unnecessary clog lookups while freezing  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Wed, Dec 28, 2022 at 4:43 PM Andres Freund <andres@anarazel.de> wrote:
> > > Hm. I dimply recall that we had repeated cases where the hint bits were set
> > > wrongly due to some of the multixact related bugs. I think I was trying to be
> > > paranoid about not freezing stuff in those situations, since it can lead to
> > > reviving dead tuples, which obviously is bad.
> >
> > I think that it's a reasonable check, and I'm totally in favor of
> > keeping it (or something very close, at least).
>
> I don't quite follow - one paragraph up you say we should fix something, and
> then here you seem to say we should continue not to rely on the hint bits?

I didn't mean that we should continue to not rely on the hint bits. Is
that really all that the test is for? I think of it as a general sanity check.

The important call to avoid with page-level freezing is the xmin call to
TransactionIdDidCommit(), not the xmax call. The xmax call only occurs
when VACUUM prepares to freeze a tuple that was updated by an updater
(not a locker) that aborted. While the xmin calls will now take place with most
unfrozen tuples.

--
Peter Geoghegan



pgsql-hackers by date:

Previous
From: Peifeng Qiu
Date:
Subject: psql: stop at error immediately during \copy
Next
From: Nikita Malakhov
Date:
Subject: Re: split TOAST support out of postgres.h