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

From: Önder Kalacı <onderkalaci(at)gmail(dot)com>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, 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:53
Message-ID: CACawEhXEQfevFCRmgSnjROoDLm-5ni-H7hquMqfkOU5kRUnyBw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Hou zj, all

>
> IIRC, it invokes tuples_equal for all cases unless we are using replica
> identity key or primary key to scan. But there seem some other cases where
> the
> tuples_equal looks unnecessary.
>
> For example, if the table on subscriber don't have a PK or RI key but have
> a
> not-null, non-deferrable, unique key. And if the apply worker choose this
> index
> to do the scan, it seems we can skip the tuples_equal as well.
>
>
Yeah, that's right. I also spotted this earlier, see* # Testcase start:
Unique index *
*that is not primary key or replica identity*

I'm thinking that we should not create any code complexity for this
case, at least with
this patch. I have a few small follow-up ideas, like this one, or allow
non-btree indexes etc.
but I'd rather not get those optional improvements to this patch, if that
makes sense.

Thanks,
Onder KALACI

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Önder Kalacı 2023-03-08 11:21:12 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Previous Message Önder Kalacı 2023-03-08 11:11:46 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher