Andres Freund <and...@anarazel.de> writes:
> We could add a wrapper node around "planner expressions" that stores
> metadata about them during planning, without those properties leaking
> over expressions used at other times. E.g. having
> preprocess_expression() return a PlannerExpr that that points to the
> expression as preprocess_expression returns it today. That'd make it
> easy to cache information like volatility. But it also seems
> prohibitively invasive :(.

I doubt it's that bad.  We could cache such info in RestrictInfo
for quals, or PathTarget for tlists, without much new notational
overhead.  That doesn't cover everything the planner deals with
of course, but it would cover enough that you'd be chasing pretty
small returns to worry about more.

                        regards, tom lane


Reply via email to