Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Dmitry Dolgov <9erthalion6(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "Hou, Zhijie" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, Floris Van Nee <florisvannee(at)optiver(dot)com>
Subject: Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)
Date: 2021-02-12 02:31:32
Message-ID: CAKU4AWpqcYOXrAwhAQZed6pU2dViFpF466H5hyVfx7+tBKwbrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 11, 2021 at 9:09 PM Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
wrote:

> Can this information be part of PathTarget structure and hence part of
> RelOptInfo::reltarget, so that it can be extended to join, group and
> other kinds of RelOptInfo in future?

I think you want to expand this field in a more generic way. For example:
SELECT udf(a) FROM t WHERE a is not null; In current implementation, I
only
knows a is not null, nothing about if udf(a) is null or not. And we can't
present anything
for joinrel as well since it is just attno.

At the same time, looks we can't tell if UDF(A) is null even if the UDF
is strict and
A is not null?

> In fact, it might be easy to do that in this patch itself.
>

Actually I can't think out the method:)

> On Wed, Feb 10, 2021 at 8:57 AM Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> wrote:
> >
> >
> > On Wed, Feb 10, 2021 at 11:18 AM Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
> wrote:
> >>
> >> Hi:
> >>
> >> This patch is the first patch in UniqueKey patch series[1], since I
> need to revise
> >> that series many times but the first one would be not that often, so
> I'd like to
> >> submit this one for review first so that I don't need to maintain it
> again and again.
> >>
> >> v1-0001-Introduce-notnullattrs-field-in-RelOptInfo-to-ind.patch
> >>
> >> Introduce notnullattrs field in RelOptInfo to indicate which attr are
> not null
> >> in current query. The not null is judged by checking pg_attribute and
> query's
> >> restrictinfo. The info is only maintained at Base RelOptInfo and
> Partition's
> >> RelOptInfo level so far.
> >>
> >>
> >> Any thoughts?
> >>
> >> [1]
> https://www.postgresql.org/message-id/CAKU4AWr1BmbQB4F7j22G%2BNS4dNuem6dKaUf%2B1BK8me61uBgqqg%40mail.gmail.com
> >> --
> >> Best Regards
> >> Andy Fan (https://www.aliyun.com/)
> >
> >
> > Add the missed patch..
> >
> > --
> > Best Regards
> > Andy Fan (https://www.aliyun.com/)
>
>
>
> --
> Best Wishes,
> Ashutosh Bapat
>

--
Best Regards
Andy Fan (https://www.aliyun.com/)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-02-12 03:02:22 Re: Parallel INSERT (INTO ... SELECT ...)
Previous Message Andy Fan 2021-02-12 02:17:48 Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)