Hi

I was looking at pull_up_subqueries
(backend/optimizer/prep/prepjointree.c 135) and I was wondering why the
recursive optimization is only done on subqueries that can be optimized.
As in, why isn't the code like:

if (rte->rtekind == RTE_SUBQUERY) {
subquery = copyObject(subquery);
if (subquery->hasSubLinks)
subquery->jointree->quals = pull_up_IN_clauses(subquery,
subquery->jointree->quals);
subquery->jointree = (FromExpr *)
pull_up_subqueries(subquery, (Node *) subquery->jointree,
false);
if (is_simple_subquery(subquery) &&
(!below_outer_join || has_nullable_targetlist(subquery)) &&
!contain_whole_tuple_var((Node *) parse, varno, 0))
{
//optimize the subquery up
}
}


--
Dennis

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppgsql-general @
categoriespostgresql
postedJan 2, '04 at 1:48p
activeJan 2, '04 at 10:29p
posts2
users2
websitepostgresql.org
irc#postgresql

2 users in discussion

Dennis Haney: 1 post Tom Lane: 1 post

People

Translate

site design / logo © 2021 Grokbase