Skip to content

Commit d998671

Browse files
committed
Enable pglogical_output caching support
Send the relmeta_cache_size parameter to the output plugin so that it enables relation metadata caching instead of sending a new set of relation metadata for each row. This will dramatically improve performance for some workloads and greatly reduce the memory churn on the downstream's relation metadata cache. Older versons of the output plugin don't understand the parameter and ignore it, then continue sending metadata for each row. That's what we already coped with before so no special action is needed.
1 parent adeb8d0 commit d998671

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pglogical.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ pglogical_start_replication(PGconn *streamConn, const char *slot_name,
262262
appendStringInfoString(&command, quote_literal_cstr(replication_sets));
263263
}
264264

265+
/* Tell the upstream that we want unbounded metadata cache size */
266+
appendStringInfoString(&command, ", \"relmeta_cache_size\" '-1'");
267+
265268
appendStringInfoChar(&command, ')');
266269

267270
res = PQexec(streamConn, command.data);

0 commit comments

Comments
 (0)