Selectively invalidate caches in pgoutput when pg_namespace is modified

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: "'pgsql-hackers(at)lists(dot)postgresql(dot)org'" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Selectively invalidate caches in pgoutput when pg_namespace is modified
Date: 2025-03-25 03:52:07
Message-ID: OSCPR01MB14966D958533C269CE996E69AF5A72@OSCPR01MB14966.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Dear hackers,

This is a follow-up thread of [1]. I think it could be considered for
PG19 but let me share now.

Background
==========
Currently, all relsync cache entries would be discarded when the pg_namespace is
modified. This mechanism works well but is sometimes not efficient.
Theoretically, it is enough to invalidate entries which it belongs to the related
schema.

Patch overview
==============
Attached patch adds a new attribute for storing the hash value for pg_namespace.oid.
It would be set when the entry is created and used for the new syscache callback
function to check whether the entry is related.

At least this patch could pass tests on my env.

[1]: https://www.postgresql.org/message-id/flat/OSCPR01MB14966C09AA201EFFA706576A7F5C92%40OSCPR01MB14966.jpnprd01.prod.outlook.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
0001-Avoid-invalidating-all-entries-when-pg_namespace-is-.patch application/octet-stream 4.1 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2025-03-25 03:53:22 Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Previous Message Michael Paquier 2025-03-25 03:51:12 Re: query_id: jumble names of temp tables for better pg_stat_statement UX