pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add function for removing arbitrary nodes in binaryheap.
Date: Mon, 18 Sep 2023 21:06:38 +0000
Message-ID: <E1qiLS1-004d6a-Ma@gemulon.postgresql.org> (raw)

Add function for removing arbitrary nodes in binaryheap.

This commit introduces binaryheap_remove_node(), which can be used
to remove any node from a binary heap.  The implementation is
straightforward.  The target node is replaced with the last node in
the heap, and then we sift as needed to preserve the heap property.
This new function is intended for use in a follow-up commit that
will improve the performance of pg_restore.

Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/3612876.1689443232%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c103d073819a2189d849c0a93d51c726be524c48

Modified Files
--------------
src/common/binaryheap.c      | 29 +++++++++++++++++++++++++++++
src/include/lib/binaryheap.h |  3 +++
2 files changed, 32 insertions(+)



Message-ID: <E1qiLS1-004d6a-Ma@gemulon.postgresql.org>
Permalink:  ../E1qiLS1-004d6a-Ma@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qiLS1-004d6a-Ma@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: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add function for removing arbitrary nodes in binaryheap.
  In-Reply-To: <E1qiLS1-004d6a-Ma@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