Neil Conway wrote:
> (b) should be pretty easy to solve; we can create a per-Query PlanState
> struct that contains this information, as well as holding a pointer to
> the Query (and perhaps the in-construct Plan tree).
I just noticed that there is a `PlanState' node in the executor, of all
places. I'm thinking of using `QueryState' instead -- this parallels the
usage of PlanState in the executor, to some degree (PlanState holds some
of the state of the executor as it examines a Plan; QueryState holds
some of the state of the planner as it examines a Query). I also
considered `PlannerState', but that doesn't seem best, as there can be
multiple instances of this struct in existence for a single invocation
of planner() (due to subqueries).
I also created a new header file, `plan_internals.h' for the declaration
of this struct, and moved a few planner-internal declarations from
planner.h to plan_internals.h -- I think it would be best to only define
external interfaces in planner.h
-Neil