The scheme I've been thinking about for clarifying the nullability
semantics of Vars might eventually provide a nicer answer for this,
but we haven't got it today.
regards, tom lane
With this direction, how about maintaining a RelOptInfo->notnullattrs (BitmapSet *)
attrs, which might be accessed in a more efficient way? We should set it to nullattrs
if it exists in groupSet clause. I introduced this attribute in UniqueKey patch [1]
(patch 0001), but it is not maintained in baserelonly now. I think we can expand it
for other types of rel as well.
However both implementations can avoid the issue here, but still make it impossible
to push down an qual even if it references all the exprs in the groupset, am I right?
--