Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher

From: Önder Kalacı <onderkalaci(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>, "wangw(dot)fnst(at)fujitsu(dot)com" <wangw(dot)fnst(at)fujitsu(dot)com>, Marco Slot <marco(dot)slot(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Date: 2023-03-08 11:11:35
Message-ID: CACawEhUDXxyqBtqnnU1a5gkrjY451mTQaCX0hvJqXoHdrWbKXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Amit, all

> You have not given complete steps to reproduce the problem where
> instead of the index scan, a sequential scan would be picked. I have
> tried to reproduce by extending your steps but didn't see the problem.
> Let me know if I am missing something.
>

I think the steps you shared are what I had in mind.

>
> I have debugged the above example and it uses an index scan during
> apply without your latest change which is what I expected. AFAICS, the
> use of IdxIsRelationIdentityOrPK() is to decide whether we will do
> tuples_equal() or not during the index scan and I see it gives the
> correct results with the example you provided.
>
>
Right, I got confused. IdxIsRelationIdentityOrPK is only called within
RelationFindReplTupleByIndex(). And, yes, it only impacts tuples_equal.

But, still, it feels safer to keep as the current patch if we don't change
the
name of the function.

I really don't have any strong opinions for either way, only a slight
preference
to keep as v35 for future callers not to get confused as we do here.

Let me know how you prefer this.

Thanks,
Onder

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Önder Kalacı 2023-03-08 11:11:46 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Previous Message Hayato Kuroda (Fujitsu) 2023-03-08 11:05:52 RE: Rework LogicalOutputPluginWriterUpdateProgress