Re: [GENERAL] Very bad plan when using VIEW and IN (SELECT...*)

2010-08-13 Thread Tom Lane
"Carlo Stonebanks" writes: >>> Having said that, modern versions of the planner seem to deal reasonably >>> well with this situation as long as they're being asked to push the >>> condition through a UNION ALL. Do you really need a UNION in that view? > This is PG v 8.3 - do you mean "modern" co

Re: [GENERAL] Very bad plan when using VIEW and IN (SELECT...*)

2010-08-13 Thread Carlo Stonebanks
N vs. UNION ALL, I think in this case UNION ALL would do. Carlo -Original Message- From: Tom Lane [mailto:t...@sss.pgh.pa.us] Sent: August 12, 2010 6:48 PM To: Carlo Stonebanks Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Very bad plan when using VIEW and IN (SELECT...*)

Re: [GENERAL] Very bad plan when using VIEW and IN (SELECT...*)

2010-08-12 Thread Tom Lane
"Carlo Stonebanks" writes: > Ref these two queries against a view: > -- QUERY 1, executes < 0.5 secs > SELECT * > FROM mdx_core.vw_provider AS p > WHERE provider_id IN (13083101) > -- QUERY 2, executes > 13.5 secs > SELECT * > FROM mdx_core.vw_provider AS p > WHERE provider_id IN (SELECT 13083101

Re: [GENERAL] Very bad plan when using VIEW and IN (SELECT...*)

2010-08-12 Thread Carlo Stonebanks
Oops, my bad - this should be in PG PERFORM! Posting it there... -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general