Re: Delay the variable initialization in get_rel_sync_entry

2022-01-05 Thread Amit Langote
On Wed, Jan 5, 2022 at 10:31 AM Michael Paquier wrote: > On Fri, Dec 24, 2021 at 01:27:26PM +, houzj.f...@fujitsu.com wrote: > > Here is the perf result of pgoutput_change after applying the patch. > > I didn't notice something else that stand out. > > > > |--2.99%--pgoutput_change > >

RE: Delay the variable initialization in get_rel_sync_entry

2022-01-04 Thread houzj.f...@fujitsu.com
On Wednesday, January 5, 2022 9:31 AM Michael Paquier wrote: > On Fri, Dec 24, 2021 at 01:27:26PM +, houzj.f...@fujitsu.com wrote: > > Here is the perf result of pgoutput_change after applying the patch. > > I didn't notice something else that stand out. > > > > |--2.99%--pgoutput_cha

Re: Delay the variable initialization in get_rel_sync_entry

2022-01-04 Thread Michael Paquier
On Fri, Dec 24, 2021 at 01:27:26PM +, houzj.f...@fujitsu.com wrote: > Here is the perf result of pgoutput_change after applying the patch. > I didn't notice something else that stand out. > > |--2.99%--pgoutput_change > |--1.80%--get_rel_sync_entry > |--

RE: Delay the variable initialization in get_rel_sync_entry

2021-12-24 Thread houzj.f...@fujitsu.com
On Friday, December 24, 2021 8:13 AM Michael Paquier wrote: > > On Thu, Dec 23, 2021 at 12:54:41PM -0300, Euler Taveira wrote: > > On Wed, Dec 22, 2021, at 10:11 AM, houzj.f...@fujitsu.com wrote: > >> The extra cost could sometimes be noticeable because get_rel_sync_entry is > a > >> hot functio

Re: Delay the variable initialization in get_rel_sync_entry

2021-12-23 Thread Michael Paquier
On Thu, Dec 23, 2021 at 12:54:41PM -0300, Euler Taveira wrote: > On Wed, Dec 22, 2021, at 10:11 AM, houzj.f...@fujitsu.com wrote: >> The extra cost could sometimes be noticeable because get_rel_sync_entry is a >> hot function which is executed for each change. And the 'am_partition' and >> 'relkind

Re: Delay the variable initialization in get_rel_sync_entry

2021-12-23 Thread Euler Taveira
On Wed, Dec 22, 2021, at 10:11 AM, houzj.f...@fujitsu.com wrote: > When reviewing some logical replication patches. I noticed that in > function get_rel_sync_entry() we always invoke get_rel_relispartition() > and get_rel_relkind() at the beginning which could cause unnecessary > cache access. >

Re: Delay the variable initialization in get_rel_sync_entry

2021-12-22 Thread Kyotaro Horiguchi
At Wed, 22 Dec 2021 13:11:38 +, "houzj.f...@fujitsu.com" wrote in > Hi, > > When reviewing some logical replication patches. I noticed that in > function get_rel_sync_entry() we always invoke get_rel_relispartition() > and get_rel_relkind() at the beginning which could cause unnecessary >

Delay the variable initialization in get_rel_sync_entry

2021-12-22 Thread houzj.f...@fujitsu.com
Hi, When reviewing some logical replication patches. I noticed that in function get_rel_sync_entry() we always invoke get_rel_relispartition() and get_rel_relkind() at the beginning which could cause unnecessary cache access. --- get_rel_sync_entry(PGOutputData *data, Oid relid) { Relati