create view pg_publication_tables as SELECT p.pubname, n.nspname AS schemaname, c.relname AS tablename FROM pg_publication p, (pg_class c JOIN pg_namespace n ON ((n.oid = c.relnamespace))) WHERE (c.oid IN (SELECT pg_get_publication_tables.relid FROM pg_get_publication_tables((p.pubname) :: text) pg_get_publication_tables (relid)));If we run both statements of that view separately
SELECT string_agg(pg_get_publication_tables.relid::text,',') FROM pg_get_publication_tables(('MyPublication')::text) pg_get_publication_tables (relid);put all those oids retrieved on that IN of the viewselect * from pg_Class c JOIN pg_namespace n ON n.oid = c.relnamespace WHERE c.oid IN (OIDs List);Then it responds immediatellySo, the question is .. can we change this view to select faster ? Just rewriting that view to a better select will solve ? Is this view used by REFRESH SUBSCRIPTION ? We think yes because if we run refresh subscription or select from view it doesn´t respond, so ...
Sent from the PostgreSQL - general mailing list archive at Nabble.com.