Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, David Rowley <dgrowleyml(at)gmail(dot)com>, pavelsivash(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS
Date: 2020-08-21 01:19:57
Message-ID: CAKU4AWrbKtXEzwMogaJTTK_xovoesrb6ERNHQB5dFMWQngHXGQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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?

[1]
https://www.postgresql.org/message-id/CAKU4AWrT%3Do0dEmdFCH3W6B%3DBeUS1%3DOU5N86FfAmKFUahSP48SA%40mail.gmail.com

--
Best Regards
Andy Fan

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Andy Fan 2020-08-21 02:08:42 Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS
Previous Message Andrew Gierth 2020-08-20 21:51:32 Re: BUG #16585: Wrong filtering on a COALESCE field after using GROUPING SETS