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: "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-02 15:22:44
Message-ID: CACawEhVk9_eSfbyEB-ej2N4FH2ZS7zc4mwXRGQWxA5LbKD+xww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> Is it just a matter of testing other
> index types
>

Yes, there are more to it. build_replindex_scan_key()
only works for btree indexes, as it does BTEqualStrategyNumber.

I might expect a few more limitations like that. I added comment
in the code (see FindUsableIndexForReplicaIdentityFull)

or there is something more to it, if so, we should add
> comments so that they can be supported in the future if it is feasible
> to do so.

I really don't see any fundamental issues regarding expanding the
support for more index types, it is just some more coding & testing.

And, I can (and willing to) work on that as a follow-up. I explicitly
try to keep this patch as small as possible.

> >
> > Attached are both patches: the main patch, and the patch that
> > optionally disables the index scans.
> >
>
> Both the patches are numbered 0001. It would be better to number them
> as 0001 and 0002.
>
>
Alright, attached v27_0001_use_index_on_subs_when_pub_rep_ident_full.patch
and
v27_0002_use_index_on_subs_when_pub_rep_ident_full.patch.

I also added one more test which Andres asked me on a private chat
(Testcase start: SUBSCRIPTION USES INDEX WITH PUB/SUB different data).

Thanks,
Onder

Attachment Content-Type Size
v27_0002_use_index_on_subs_when_pub_rep_ident_full.patch application/x-patch 50.3 KB
v27_0001_use_index_on_subs_when_pub_rep_ident_full.patch application/x-patch 68.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kuntal Ghosh 2023-03-02 15:27:23 Re: Allow logical replication to copy tables in binary format
Previous Message Laurenz Albe 2023-03-02 14:56:39 Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)