pgsql: Use direct hash lookup in logicalrep_partmap_invalidate_cb() - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Use direct hash lookup in logicalrep_partmap_invalidate_cb()
Date
Msg-id E1wo9ah-00000000S6D-0eC8@gemulon.postgresql.org
Whole thread
List pgsql-committers
Use direct hash lookup in logicalrep_partmap_invalidate_cb()

This replaces an O(N) hash_seq_search() loop by an O(1) lookup, removing
a TODO item, making the invalidation callback faster when dealing with
many relations.  This can work because LogicalRepPartMap is keyed by a
partition OID, and a relmapentry's localreloid matches with it.

An assertion is added in logicalrep_partition_open() to enforce the fact
that localreloid matches with the hash key.

Author: DaeMyung Kang <charsyam@gmail.com>
Discussion: https://postgr.es/m/20260417174450.4158878-1-charsyam@gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0962f9e344390c69e44bc55675510b2fa2b3f778

Modified Files
--------------
src/backend/replication/logical/relation.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)


Attachment

pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: pgsql: Add _bt_set_startikey row compare test coverage.