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