mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 13:56:59 +08:00
On Publication rename, we need to only invalidate the RelationSyncCache entries corresponding to relations that are part of the publication being renamed. As part of this patch, we introduce a new invalidation message to invalidate the cache maintained by the logical decoding output plugin. We can't use existing relcache invalidation for this purpose, as that would unnecessarily cause relcache invalidations in other backends. This will improve performance by building fewer relation cache entries during logical replication. Author: Hayato Kuroda <kuroda.hayato@fujitsu.com> Author: Shlok Kyal <shlok.kyal.oss@gmail.com> Reviewed-by: Hou Zhijie <houzj.fnst@fujitsu.com> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/OSCPR01MB14966C09AA201EFFA706576A7F5C92@OSCPR01MB14966.jpnprd01.prod.outlook.com
86 lines
2.4 KiB
C
86 lines
2.4 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* inval.h
|
|
* POSTGRES cache invalidation dispatcher definitions.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/utils/inval.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef INVAL_H
|
|
#define INVAL_H
|
|
|
|
#include "access/htup.h"
|
|
#include "storage/relfilelocator.h"
|
|
#include "utils/relcache.h"
|
|
|
|
extern PGDLLIMPORT int debug_discard_caches;
|
|
|
|
typedef void (*SyscacheCallbackFunction) (Datum arg, int cacheid, uint32 hashvalue);
|
|
typedef void (*RelcacheCallbackFunction) (Datum arg, Oid relid);
|
|
typedef void (*RelSyncCallbackFunction) (Datum arg, Oid relid);
|
|
|
|
|
|
extern void AcceptInvalidationMessages(void);
|
|
|
|
extern void AtEOXact_Inval(bool isCommit);
|
|
|
|
extern void PreInplace_Inval(void);
|
|
extern void AtInplace_Inval(void);
|
|
extern void ForgetInplace_Inval(void);
|
|
|
|
extern void AtEOSubXact_Inval(bool isCommit);
|
|
|
|
extern void PostPrepare_Inval(void);
|
|
|
|
extern void CommandEndInvalidationMessages(void);
|
|
|
|
extern void CacheInvalidateHeapTuple(Relation relation,
|
|
HeapTuple tuple,
|
|
HeapTuple newtuple);
|
|
extern void CacheInvalidateHeapTupleInplace(Relation relation,
|
|
HeapTuple tuple,
|
|
HeapTuple newtuple);
|
|
|
|
extern void CacheInvalidateCatalog(Oid catalogId);
|
|
|
|
extern void CacheInvalidateRelcache(Relation relation);
|
|
|
|
extern void CacheInvalidateRelcacheAll(void);
|
|
|
|
extern void CacheInvalidateRelcacheByTuple(HeapTuple classTuple);
|
|
|
|
extern void CacheInvalidateRelcacheByRelid(Oid relid);
|
|
|
|
extern void CacheInvalidateRelSync(Oid relid);
|
|
|
|
extern void CacheInvalidateRelSyncAll(void);
|
|
|
|
extern void CacheInvalidateSmgr(RelFileLocatorBackend rlocator);
|
|
|
|
extern void CacheInvalidateRelmap(Oid databaseId);
|
|
|
|
extern void CacheRegisterSyscacheCallback(int cacheid,
|
|
SyscacheCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CacheRegisterRelcacheCallback(RelcacheCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CacheRegisterRelSyncCallback(RelSyncCallbackFunction func,
|
|
Datum arg);
|
|
|
|
extern void CallSyscacheCallbacks(int cacheid, uint32 hashvalue);
|
|
|
|
extern void CallRelSyncCallbacks(Oid relid);
|
|
|
|
extern void InvalidateSystemCaches(void);
|
|
extern void InvalidateSystemCachesExtended(bool debug_discard);
|
|
|
|
extern void LogLogicalInvalidations(void);
|
|
#endif /* INVAL_H */
|