Re: pull_up_subqueries question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Haney <davh(at)diku(dot)dk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pull_up_subqueries question
Date: 2004-01-02 14:53:37
Message-ID: 5687.1073055217@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dennis Haney <davh(at)diku(dot)dk> writes:
> 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.

Because it will be done when the subquery is planned (via recursion to
subquery_planner), if the subquery is left as a separate subquery.
The only reason pull_up_subqueries has to do this at all is that it has
already been done to the rest of the upper query, and so we would miss
doing it to the pulled-up part of the tree if we didn't do it here.
Compare the order of operations in subquery_planner.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ezra epstein 2004-01-02 15:00:10 7.4 ERROR: CREATE LOCAL TEMPORARY TABLE ... ON COMMIT DROP inside a function
Previous Message ezra epstein 2004-01-02 14:50:56 7.4 Alter User xxx VALID UNTIL '2000-01-01' does not work