Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher - Mailing list pgsql-hackers

From vignesh C
Subject Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Date
Msg-id CALDaNm3B3+XajLcDTpfwdTe=_ijHNRKjB7TFtDHE0TbeTsEFmA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher  (Önder Kalacı <onderkalaci@gmail.com>)
Responses Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher  (Önder Kalacı <onderkalaci@gmail.com>)
List pgsql-hackers
On Wed, 8 Mar 2023 at 21:46, Önder Kalacı <onderkalaci@gmail.com> wrote:
>
> Hi Vignesh C,
>
>>
>>
>> Few comments
>> 1) Maybe this change is not required:
>>     fallback if no other solution is possible.  If a replica identity other
>>     than <quote>full</quote> is set on the publisher side, a replica identity
>> -   comprising the same or fewer columns must also be set on the subscriber
>> -   side.  See <xref linkend="sql-altertable-replica-identity"/> for details on
>> +   comprising the same or fewer columns must also be set on the
>> subscriber side.
>> +   See <xref linkend="sql-altertable-replica-identity"/> for details on
>
>
> Yes, fixed.
>>
>>
>> 2) Variable declaration and the assignment can be split so that the
>> readability is better:
>> +
>> +               bool            isUsableIndex =
>> +                       IsIndexUsableForReplicaIdentityFull(indexInfo);
>> +
>> +               index_close(indexRelation, AccessShareLock);
>> +
>
>
> Hmm, can you please elaborate more on this? The declaration
> and assignment are already on different lines.
>
> ps: pgindent changed this line a bit. Does that look better?

I thought of changing it to something like below:
bool isUsableIndex;
Oid idxoid = lfirst_oid(lc);
Relation indexRelation = index_open(idxoid, AccessShareLock);
IndexInfo  *indexInfo = BuildIndexInfo(indexRelation);

isUsableIndex = IsIndexUsableForReplicaIdentityFull(indexInfo);

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Add pg_walinspect function with block info columns
Next
From: Pavel Stehule
Date:
Subject: Re: proposal - get_extension_version function