Re: Another planner bug with subqueries - Mailing list pgsql-general

From Tom Lane
Subject Re: Another planner bug with subqueries
Date
Msg-id 13851.1039215216@sss.pgh.pa.us
Whole thread Raw
In response to Another planner bug with subqueries  (Matthew Gabeler-Lee <mgabelerlee@zycos.com>)
List pgsql-general
Matthew Gabeler-Lee <mgabelerlee@zycos.com> writes:
> When a view contains a subquery, sorted queries on the view don't put the
> sort inside the view query like they should.  7.2.3 did it properly, and so
> my most common query has now gone from <3s to several minutes.

This is a consequence of my quick-hack solution to your previous
problem: views with subselects in their targetlist will not be
flattened.

I'm afraid there's not much to be done about it for 7.3.* --- AFAICS,
a proper fix would be too big and too risky to put into the stable
branch.  The correct long-term fix (flatten join alias vars earlier)
has to wait until we do some fundamental planner work, and I don't
see any other safe quick-hack answer.

            regards, tom lane

pgsql-general by date:

Previous
From: Rodrigo Leroux
Date:
Subject: too much context switching?
Next
From: Laurette Cisneros
Date:
Subject: bug?