Andres Freund <and...@anarazel.de> writes: > On 2018-01-16 17:05:01 -0500, Tom Lane wrote: >> I'm curious to know whether Andres has some other ideas, or whether he >> feels this is all a big wart on the compiled-expression concept.
> I don't have too many "artistic" concerns from the compiled expression > POV. The biggest issue I see is that it'll make it a bit harder to > separate out the expression compilation phase from the expression > instantiation phase - something I think we definitely want. Hmm, there's no such distinction now, so could you explain what you have in mind there? >> I don't think there are any existing cases where we keep any >> meaningful state across executions of a compiled-expression data >> structure; maybe that's a bad idea in itself. > Storing all cached values in an EState or ExprContext (the > latter referring to the former) somewhat alike the values for Param's > sounds a lot more reasonable to me. > ... > This all reminds me a lot of the infrastructure for Params... Yeah, one thing I was thinking about in connection with this is the stuff associated with propagating changes in outer-reference Params (the extParam/allParam/chgParam mess). I wonder if we could find a way to unify that with this feature. Keeping the stored value of a CachedExpr in a Param slot is an interesting idea indeed. regards, tom lane