On 07/03/2013 08:32 PM, Tom Lane wrote:
> Another possibility would be to keep the optimization, but disable it in
> queries that use LATERAL. I don't much care for that though --- seems
> too Rube Goldbergish, and in any case I have a lot less faith in the
> whole concept now than I had before I started digging into this issue.
>
> Thoughts?
>
I noticed EXPLAIN in some regression tests. So if they all pass after
removal of this optimization, it might indicate that it was really
insignificant. But alternatively it may just be a lack of focus on this
feature in the test queries. Digging for (non-LATERAL) queries or rather
patterns where the ph_may_need optimization clearly appears to be
important sounds to me like a good SQL exercise, but I'm afraid I won't
have time for it in the next few days.
//Antonin Houska (Tony)