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

From: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
To: Önder Kalacı <onderkalaci(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(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-06 10:48:10
Message-ID: CAFiTN-vcxzzZNFyPmYgF5-iNErcivDo-kes7LdL0KmfKZ0p3bA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 6, 2023 at 2:38 PM Önder Kalacı <onderkalaci(at)gmail(dot)com> wrote:
>
I was going through the thread and patch, I noticed that in the
initial version, we were depending upon the planner to let it decide
whether index scan is cheaper or not and which index to pick. But in
the latest patch if a useful index exists then we chose that without
comparing the cost of whether it is cheaper than sequential scan or
not. Is my understanding correct? What is the reason for the same,
one reason I could see while looking into the thread is that we can
not just decide once whether the index scan is cheaper or not because
that decision could change in the future but isn't that better than
never checking whether index scan is cheaper or not. Because in some
cases where column selectivity is high like 80-90% then the index can
be very costly due to random page fetches. So I think we could easily
produce regression in some cases, have we tested those cases?

Let me if I am missing something.

--
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2023-03-06 10:50:54 Re: [PATCH] Add CANONICAL option to xmlserialize
Previous Message Amit Kapila 2023-03-06 10:44:24 Re: Deduplicate logicalrep_read_tuple()