RE: Parallel Apply

Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>

From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Amit Kapila' <amit.kapila16@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Tomas Vondra <tomas@vondra.me>, Dilip Kumar <dilipbalaut@gmail.com>, Andrei Lepikhov <lepihov@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, wenhui qiu <qiuwenhuifx@gmail.com>
Date: 2026-04-14T12:21:41Z
Lists: pgsql-hackers
Dear Amit,

Thanks for the comment.

> + if (!replica_identity_table)
> + replica_identity_table = replica_identity_create(ApplyContext,
> + REPLICA_IDENTITY_INITIAL_SIZE,
> + NULL);
> 
> We can add some comments why we create this in ApplyContext. BTW, can
> we consider a separate ParallelApplyContext for this though I am not
> sure if that will be really helpful. Do you have any thoughts on the
> same?

I did not separate the context because it can work as-is. However, dividing
context allows tracking the growth of hash table easily by using
pg_log_backend_memory_contexts() or MemoryContextStats() (via gdb). Now new memory context
is used.

New version would be posted soon.

Best regards,
Hayato Kuroda
FUJITSU LIMITED