Re: Re: Refresh Publication takes hours and doesn´t finish - Mailing list pgsql-general

From Fabrízio de Royes Mello
Subject Re: Re: Refresh Publication takes hours and doesn´t finish
Date
Msg-id CAPfkCSDXY4vDRYta6ppEegedvjo2W9e4B7H+Qbujj-+CnOVfdg@mail.gmail.com
Whole thread Raw
In response to Re: Re: Refresh Publication takes hours and doesn´t finish  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re: Refresh Publication takes hours and doesn´t finish
List pgsql-general


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

pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: Loading table with indexed jsonb field is stalling
Next
From: Will Hartung
Date:
Subject: Re: Loading table with indexed jsonb field is stalling