Re: pgsql: Fix O(N^2) performance issue in pg_publication_tables view.

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: Fix O(N^2) performance issue in pg_publication_tables view.
Date: 2019-05-22 20:24:29
Message-ID: CAFcNs+qTDTY-p7Sz-TNr5EM83c8rTh3yFiHHcYhq+3ruBEScbQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Wed, May 22, 2019 at 4:57 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> > There are some case I missed to force us to use
pg_get_publication_tables
> > SRF instead of use pg_publication_rel ??
>
> pg_publication_rel isn't going to provide the correct expansion of
> a FOR ALL TABLES publication, IIUC.
>

You're correct... there are a condition for it in pg_get_publication_tables
and FOR ALL TABLES publications doesn't persist anything in
pg_publication_rel.

497 publication = GetPublicationByName(pubname, false);
498 if (publication->alltables)
499 tables = GetAllTablesPublicationRelations();
500 else
501 tables = GetPublicationRelations(publication->oid);

Thanks for clarifying!

Regards,

--
Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-05-22 22:59:18 Re: pgsql: Make VACUUM accept 1 and 0 as a boolean value.
Previous Message Tom Lane 2019-05-22 19:57:47 Re: pgsql: Fix O(N^2) performance issue in pg_publication_tables view.