On 22 Mar 2012, at 10:17, Albe Laurenz wrote:
Thank you - I did come to a similar method yesterday following some pointers from previous messages but I'm glad to have some confirmation it's the right direction. It does perform an order of magnitude faster for me, from 500ms down to under 20ms. My exact query is SELECT distinct dependent.relname FROM pg_depend JOIN pg_rewrite ON pg_depend.objid = pg_rewrite.oid JOIN pg_class as dependent ON pg_rewrite.ev_class = dependent.oid JOIN pg_class as dependee ON pg_depend.refobjid = dependee.oid WHERE dependee.relname = 'myviewname' AND dependent.relname != 'myviewname' Haven't tested this much yet either. I'll compare yours to mine and check the differences. Regards Oliver |