From: Tom Lane Date: Sun, 17 Aug 2008 02:19:19 +0000 (+0000) Subject: Remove prohibition against SubLinks in the WHERE clause of an EXISTS subquery X-Git-Tag: recoveryinfrav9~731 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=1fd289ade12adbf9ceab44d976bd56d8594a8427;p=users%2Fsimon%2Fpostgres.git Remove prohibition against SubLinks in the WHERE clause of an EXISTS subquery that we're considering pulling up. I hadn't wanted to think through whether that could work during the first pass at this stuff. However, on closer inspection it seems to be safe enough. --- diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c index e1f58100e3..b861728502 100644 --- a/src/backend/optimizer/plan/subselect.c +++ b/src/backend/optimizer/plan/subselect.c @@ -969,14 +969,6 @@ convert_EXISTS_sublink_to_join(PlannerInfo *root, SubLink *sublink, if (contain_volatile_functions(whereClause)) return false; - /* - * Also disallow SubLinks within the WHERE clause. (XXX this could - * probably be supported, but it would complicate the transformation - * below, and it doesn't seem worth worrying about in a first pass.) - */ - if (contain_subplans(whereClause)) - return false; - /* * Prepare to pull up the sub-select into top range table. *