pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Handle non-chain tuples outside of heap_prune_chain()
Date: Mon, 01 Apr 2024 17:35:14 +0000
Message-ID: <E1rrLYw-0000d8-A4@gemulon.postgresql.org> (raw)

Handle non-chain tuples outside of heap_prune_chain()

Handle dead branches of aborted HOT chains outside heap_prune_chain()
as a separate phase. This simplifies the logic in heap_prune_chain(),
as well as allowing us to clean up more RECENTLY_DEAD -> DEAD chains.

To accomplish this efficiently, partition tuples into HOT and non-HOT
while first collecting visibility information for each tuple in
heap_page_prune(). Then call heap_prune_chain() only on potential
chain members. Then mop up the leftover HOT tuples afterwards.

As part of this, keep track of which items on page have already been
processed, in 'processed' array. This replaces the 'marked' array
which was only set for tuples marked for removal or redirection. The
'processed' array is updated also for items that are left unchanged,
when we conclude that an item can be left unchanged. At the end of
pruning, every item on the page should be marked as processed in the
array; an assertion is added for that.

Author: Melanie Plageman <melanieplageman@gmail.com>
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Discussion: https://www.postgresql.org/message-id/20240330055710.kqg6ii2cdojsxgje@liskov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6f47f6883151366c031cd6fd4011e66d2c702a90

Modified Files
--------------
src/backend/access/heap/pruneheap.c | 289 +++++++++++++++++++++++-------------
1 file changed, 187 insertions(+), 102 deletions(-)



Message-ID: <E1rrLYw-0000d8-A4@gemulon.postgresql.org>
Permalink:  ../E1rrLYw-0000d8-A4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rrLYw-0000d8-A4@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: heikki.linnakangas@iki.fi, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Handle non-chain tuples outside of heap_prune_chain()
  In-Reply-To: <E1rrLYw-0000d8-A4@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox