Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ce1608

Browse files
committed
Reduce relcache access in WAL sender streaming logical changes
get_rel_sync_entry(), which is called each time a change needs to belogically replicated, is a rather hot code path in the WAL sendersending logical changes. This code path was doing a relcache access onrelkind and relpartition for each logical change, but we only need toknow this information when building or re-building the cachedinformation for a relation.Some measurements prove that this is noticeable in perf profiles,particularly when attempting to replicate changes from relations thatare not published as these cause less overhead in the WAL sender,delaying further the replication of changes for relations that arepublished.Issue introduced in83fd453.Author: Hou ZhijieReviewed-by: Kyotaro Horiguchi, Euler TaveiraDiscussion:https://postgr.es/m/OS0PR01MB5716E863AA9E591C1F010F7A947D9@OS0PR01MB5716.jpnprd01.prod.outlook.comBackpatch-through: 13
1 parent913a03e commit6ce1608

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/replication/pgoutput/pgoutput.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,8 +1119,6 @@ static RelationSyncEntry *
11191119
get_rel_sync_entry(PGOutputData*data,Oidrelid)
11201120
{
11211121
RelationSyncEntry*entry;
1122-
boolam_partition=get_rel_relispartition(relid);
1123-
charrelkind=get_rel_relkind(relid);
11241122
boolfound;
11251123
MemoryContextoldctx;
11261124

@@ -1160,6 +1158,8 @@ get_rel_sync_entry(PGOutputData *data, Oid relid)
11601158
List*schemaPubids=GetSchemaPublications(schemaId);
11611159
ListCell*lc;
11621160
Oidpublish_as_relid=relid;
1161+
boolam_partition=get_rel_relispartition(relid);
1162+
charrelkind=get_rel_relkind(relid);
11631163

11641164
/* Reload publications if needed before use. */
11651165
if (!publications_valid)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp