Jan Wieck wrote:
>
> So I assume the sublink->subselect, that's copied into the
> plan, is totally obsolete too at that point. The subplan has
> it's own rangetable, which is the same as the (not used) one
> in the subselect.
Exactly.
> I think I should tidy up that all to finally pass only plan
> into executor before going ahead with the deferred query
> stuff. It doesn't make sense to spend much efford now to
> prepare the system for deferred queries. It depends too much
> on where the RTE's are and how we organize them.
>
> New TopPlan could be passed down the executor instead of
> querytree. It might hold a List of rangetables. Plan and
> SubPlan then have an index telling which nth() rangetable of
> TopPlan to use for it.
>
> This would make execution preprocessing for snapshot->RTE
> assignment very easy because there's only one place to find
> ALL RTE's (no need to traverse down a tree). And it would
> substantial lower the amount of data to copy in SPI, since it
> must not save the Querytree at all.
Nice!
Vadim