pgsql: Delay commit status checks until freezing executes.

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Delay commit status checks until freezing executes.
Date: 2023-01-03 19:23:41
Message-ID: E1pCmsu-001snM-Rr@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Delay commit status checks until freezing executes.

pg_xact lookups are relatively expensive. Move the xmin/xmax commit
status checks from the point that freeze plans are prepared to the point
that they're actually executed. Otherwise we'll repeat many commit
status checks whenever multiple successive VACUUM operations scan the
same pages and decide against freezing each time, which is a waste of
cycles.

Oversight in commit 1de58df4, which added page-level freezing.

Author: Peter Geoghegan <pg(at)bowt(dot)ie>
Discussion: https://postgr.es/m/CAH2-WzkZpe4K6qMfEt8H4qYJCKc2R7TPvKsBva7jc9w7iGXQSw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/79d4bf4eff14d8967b10ad4c60039c1b9b0cf66e

Modified Files
--------------
src/backend/access/heap/heapam.c | 89 ++++++++++++++++++++++++++++------------
src/include/access/heapam.h | 9 ++++
2 files changed, 71 insertions(+), 27 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2023-01-03 19:49:34 pgsql: vacuumlazy.c: Save get_database_name() in vacrel.
Previous Message Peter Geoghegan 2023-01-03 18:09:49 pgsql: Refine the definition of page-level freezing.

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2023-01-03 19:43:10 Re: allowing for control over SET ROLE
Previous Message Tom Lane 2023-01-03 19:15:46 Re: CAST(... ON DEFAULT) - WIP build on top of Error-Safe User Functions