From: Fabrízio de Royes Mello <fabrizio@timbira.com.br>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PegoraroF10 <marcos@f10.com.br>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Re: Refresh Publication takes hours and doesn´t finish
Date: Mon, 20 May 2019 18:37:16 -0300
Message-ID: <CAPfkCSDXY4vDRYta6ppEegedvjo2W9e4B7H+Qbujj-+CnOVfdg@mail.gmail.com> (raw)
In-Reply-To: <12632.1558387804@sss.pgh.pa.us>
References: <1551385426763-0.post@n3.nabble.com>
<1558383480253-0.post@n3.nabble.com>
<12632.1558387804@sss.pgh.pa.us>
Em seg, 20 de mai de 2019 às 18:30, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
>
> Hmm ... given that pg_get_publication_tables() shouldn't return any
> duplicate OIDs, it does seem unnecessarily inefficient to put it in
> an IN-subselect condition. Peter, is there a reason why this isn't
> a straight lateral join? I get a much saner-looking plan from
>
> FROM pg_publication P, pg_class C
> - JOIN pg_namespace N ON (N.oid = C.relnamespace)
> - WHERE C.oid IN (SELECT relid FROM
pg_get_publication_tables(P.pubname));
> + JOIN pg_namespace N ON (N.oid = C.relnamespace),
> + LATERAL pg_get_publication_tables(P.pubname)
> + WHERE C.oid = pg_get_publication_tables.relid;
>
And why not just JOIN direct with pg_publication_rel ?
Regards,
--
Fabrízio de Royes Mello Timbira - http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: fabrizio@timbira.com.br, tgl@sss.pgh.pa.us, marcos@f10.com.br, peter.eisentraut@2ndquadrant.com
Subject: Re: Refresh Publication takes hours and doesn´t finish
In-Reply-To: <CAPfkCSDXY4vDRYta6ppEegedvjo2W9e4B7H+Qbujj-+CnOVfdg@mail.gmail.com>
References: <1551385426763-0.post@n3.nabble.com> <1558383480253-0.post@n3.nabble.com> <12632.1558387804@sss.pgh.pa.us> <CAPfkCSDXY4vDRYta6ppEegedvjo2W9e4B7H+Qbujj-+CnOVfdg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox