Selectively invalidate caches in pgoutput when pg_namespace is modified

Started by Hayato Kuroda (Fujitsu)over 1 year ago2 messageshackers

Thread notes

1 note#performance#minor#enhancement
hackorum-bot#performance#minor#enhancement
hackorum-bot
1 day ago

@global #performance #minor #enhancement

#performance#minor#enhancement
Jump to latest
#1Hayato Kuroda (Fujitsu)
kuroda.hayato@fujitsu.com

Dear hackers,

This is a follow-up thread of [1]/messages/by-id/OSCPR01MB14966C09AA201EFFA706576A7F5C92@OSCPR01MB14966.jpnprd01.prod.outlook.com. 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]: /messages/by-id/OSCPR01MB14966C09AA201EFFA706576A7F5C92@OSCPR01MB14966.jpnprd01.prod.outlook.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachments:

0001-Avoid-invalidating-all-entries-when-pg_namespace-is-.patchapplication/octet-stream; name=0001-Avoid-invalidating-all-entries-when-pg_namespace-is-.patchDownload+20-19
#2Hayato Kuroda (Fujitsu)
kuroda.hayato@fujitsu.com
In reply to: Hayato Kuroda (Fujitsu) (#1)
RE: Selectively invalidate caches in pgoutput when pg_namespace is modified

Dear hackers,

The patch needs to be rebased due to the recent commit ee642cc.
Please see the updated version. SysCacheIdentifier is used instead of int.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachments:

t51290_2
v2-0001-Avoid-invalidating-all-entries-when-pg_namespace-.patchapplication/octet-stream; name=v2-0001-Avoid-invalidating-all-entries-when-pg_namespace-.patchDownload+20-18