Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series) - Mailing list pgsql-hackers

From Andy Fan
Subject Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)
Date
Msg-id CAKU4AWpQmMdRhxwRBAL44BTzdJRi7oHj3-phinPTJS8w+qz7ig@mail.gmail.com
Whole thread Raw
In response to Re: Keep notnullattrs in RelOptInfo (Was part of UniqueKey patch series)  (Andy Fan <zhihui.fan1213@gmail.com>)
List pgsql-hackers
Unknown why people have so little interest in this, AFAICS, there are more great
usages of UniqueKey rather than the 'marking-distinct-as-noop'. The most
exciting usage for me is it is helpful for JoinRel's pathkey.

Take an example of this:

SELECT .. FROM t1 JOIN t2 ON t1.any_column = t2.uniquekey;
SELECT .. FROM t1 LEFT JOIN t2 ON t1.any_column = t2.uniquekey;

Suppose before the join, t1 has a pathkey X,  t2 has PathKey y. Then
(t1.X, t2.Y) is
ordered as well for JoinRel(t1, t2).  Then the pathkey of JoinRel(t1,
t2)  has a lot
of usage again.  Currently after the joining, only the outer join's
pathkey is maintained.

As for the extra planning cost of this, it looks like our current
infrastructure can support it
well since we know all the information when we generate the pathkey
for the Join Path.

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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Commitfest 2021-11 Patch Triage - Part 1
Next
From: "tanghy.fnst@fujitsu.com"
Date:
Subject: RE: row filtering for logical replication