Re: Refresh Publication takes hours and doesn´t finish

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Refresh Publication takes hours and doesn´t finish
Дата
Msg-id 9285a255-3cf9-4bad-6e87-8668f179afa2@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: Re: Refresh Publication takes hours and doesn´t finish  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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



В списке pgsql-general по дате отправления:

Предыдущее
От: Thiemo Kellner
Дата:
Сообщение: Re: Table inheritance over schema boundaries possible
Следующее
От: "bret_stern@machinemanagement.com"
Дата:
Сообщение: Re: Data entry / data editing tools (more end-user focus).