> However, the *real* problem here is that the inner query is treated
> as a subplan, which means it is re-evaluated for each tuple scanned
> by the outer query. This is not very bright; the system ought to
> notice that the inner query does not depend on the state of the
> outer query, and do it only once. There is already a notion of
> InitPlan vs. SubPlan. I'm not sure why this case is being classified
> as a SubPlan, but it sure looks like it ought to be done as an
> InitPlan...So this means, it is a bug somewhere in the planner?who should we report this??
Attila
any workarounds?
[better than temptables?]