RE: Selectively invalidate caches in pgoutput module - Mailing list pgsql-hackers

From Hayato Kuroda (Fujitsu)
Subject RE: Selectively invalidate caches in pgoutput module
Date
Msg-id OSCPR01MB14966DBBE4666C701FB8943E0F5D62@OSCPR01MB14966.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: Selectively invalidate caches in pgoutput module  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Responses Re: Selectively invalidate caches in pgoutput module
RE: Selectively invalidate caches in pgoutput module
List pgsql-hackers
Dear Hou,

> Currently, only the leaf partition is invalidated when the published table is
> partitioned. However, I think pgoutput could cache both the partitioned table
> and the leaf partition table as relsync entries.
> 
> For INSERT/UPDATE/DELETE on a partitioned table, only the leaf partition's
> relsync entry is used in pgoutput, but the TRUNCATE references the parent
> table's relsync entry.

I think your analysis is correct. PSA new version. Below part contains my analysis.

In ExecuteTruncate(), if the specified relation has children, all of them are
checked via find_all_inheritors() and listed as target. Also, ExecuteTruncateGuts()
serializes both a parent and children in XLOG_HEAP_TRUNCATE WAL record.
Decoding layer passes relations as-is. These facts mean that output plugins can
store caches on the memory.

Best regards,
Hayato Kuroda
FUJITSU LIMITED


Attachment

pgsql-hackers by date:

Previous
From: Yuki Seino
Date:
Subject: Re: Add “FOR UPDATE NOWAIT” lock details to the log.
Next
From: Daniel Gustafsson
Date:
Subject: Re: Changing the state of data checksums in a running cluster