Avoid invalidating all RelationSyncCache entries on publication change. On change of publication via ALTER PUBLICATION ... SET/ADD/DROP commands, we were invalidating all the relations present in relation sync cache maintained by pgoutput. We need to invalidate only the relation entries that are changed as part of publication DDL.
We have ensured that the publication DDL execution generated the invalidations required to invalidate impacted relation sync entries in RelationSyncCache. This improves the performance by avoiding building the cache entries for the cases where a publication has many tables but only one of them is dropped. Author: Shlok Kyal <shlok.kyal....@gmail.com> Author: Hayato Kuroda <kuroda.hay...@fujitsu.com> Reviewed-by: Hou Zhijie <houzj.f...@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapil...@gmail.com> Discussion: https://postgr.es/m/oscpr01mb14966c09aa201effa706576a7f5...@oscpr01mb14966.jpnprd01.prod.outlook.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/588acf6d0ec15d9384c2f712585c0f56936d7bac Modified Files -------------- src/backend/replication/pgoutput/pgoutput.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-)