From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: PegoraroF10 <marcos@f10.com.br>
Cc: pgsql-general@postgresql.org
Subject: Re: Refresh Publication takes hours and doesn´t finish
Date: Thu, 23 May 2019 15:08:37 +0200
Message-ID: <9285a255-3cf9-4bad-6e87-8668f179afa2@2ndquadrant.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>
On 2019-05-20 23:30, Tom Lane wrote:
> 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;
No reason I think, just didn't quite manage to recognize the possibility
of using LATERAL at the time.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, marcos@f10.com.br
Subject: Re: Refresh Publication takes hours and doesn´t finish
In-Reply-To: <9285a255-3cf9-4bad-6e87-8668f179afa2@2ndquadrant.com>
References: <1551385426763-0.post@n3.nabble.com> <1558383480253-0.post@n3.nabble.com> <12632.1558387804@sss.pgh.pa.us> <9285a255-3cf9-4bad-6e87-8668f179afa2@2ndquadrant.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