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

From Amit Kapila
Subject Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Date
Msg-id CAA4eK1+Wpf4CeK44DOZ_yjFmy=YiPSHs_tczDPBbJaWcKWndsw@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  ("shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>)
List pgsql-hackers
On Fri, Mar 10, 2023 at 5:16 PM Önder Kalacı <onderkalaci@gmail.com> wrote:
>
>>
>> wip_for_optimize_index_column_match
>> +static bool
>> +IndexContainsAnyRemoteColumn(IndexInfo  *indexInfo,
>> + LogicalRepRelation  *remoterel)
>> +{
>> + for (int i = 0; i < indexInfo->ii_NumIndexAttrs; i++)
>> + {
>>
>> Wouldn't it be better to just check if the first column is not part of
>> the remote column then we can skip that index?
>
>
> Reading [1], I think I can follow what you suggest. So, basically,
> if the leftmost column is not filtered, we have the following:
>
>>  but the entire index would have to be scanned, so in most cases the planner would prefer a sequential table scan
overusing the index. 
>
>
> So, in our case, we could follow a similar approach. If the leftmost column of the index
> is not sent over the wire from the pub, we can prefer the sequential scan.
>
> Is my understanding of your suggestion accurate?
>

Yes. I request an opinion from Shi-San who has reported the problem.

--
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Pavel Luzanov
Date:
Subject: Re: psql: Add role's membership options to the \du+ command
Next
From: "Takamichi Osumi (Fujitsu)"
Date:
Subject: RE: Rework LogicalOutputPluginWriterUpdateProgress