| From: | Fabrízio de Royes Mello <fabrizio(at)timbira(dot)com(dot)br> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | PegoraroF10 <marcos(at)f10(dot)com(dot)br>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Postgres General <pgsql-general(at)postgresql(dot)org> |
| Subject: | Re: Re: Refresh Publication takes hours and doesn´t finish |
| Date: | 2019-05-20 21:37:16 |
| Message-ID: | CAPfkCSDXY4vDRYta6ppEegedvjo2W9e4B7H+Qbujj-+CnOVfdg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general pgsql-hackers |
Em seg, 20 de mai de 2019 às 18:30, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Will Hartung | 2019-05-20 21:48:05 | Re: Loading table with indexed jsonb field is stalling |
| Previous Message | Ron | 2019-05-20 21:36:58 | Re: Loading table with indexed jsonb field is stalling |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andres Freund | 2019-05-20 22:17:19 | Re: PG 12 draft release notes |
| Previous Message | Tom Lane | 2019-05-20 21:30:04 | Re: Re: Refresh Publication takes hours and doesn´t finish |