Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS - Mailing list pgsql-bugs

From Andy Fan
Subject Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS
Date
Msg-id CAKU4AWrbKtXEzwMogaJTTK_xovoesrb6ERNHQB5dFMWQngHXGQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs


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?



-- 
Best Regards
Andy Fan

pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS
Next
From: Andy Fan
Date:
Subject: Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS