Hi, On 2019-12-20 11:12:53 -0500, Tom Lane wrote: > (2) Explicitly mark Vars as being nullable by some outer join. I think > we could probably get this down to one additional integer field in > struct Var, so it wouldn't be too much of a penalty.
I've for a while wished that we could, e.g. so execution can use faster tuple deforming code, infer nullability of columns above the scan level. Right now there's no realistic way ExecTypeFromTL() can figure that out, for upper query nodes. If we were to introduce something like the field you suggest, it'd be darn near trivial. OTOH, I'd really at some point like to start moving TupleDesc computations to the planner - they're quite expensive, and we do them over and over again. And that would not necessarily need a convenient execution time representation anymore. But I don't think moving tupledesc computation into the planner is a small rearrangement... Would we want to have only boolean state, or more information (e.g. not null, maybe null, is null)? Greetings, Andres Freund