Re: Removing unneeded self joins

From: Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>
To: "Andrey V(dot) Lepikhov" <a(dot)lepikhov(at)postgrespro(dot)ru>, David Rowley <dgrowleyml(at)gmail(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing unneeded self joins
Date: 2020-11-27 09:19:20
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 31.10.2020 12:26, Andrey V. Lepikhov wrote:
> Thank you for this partial review, I included your changes:
> On 9/23/20 9:23 AM, David Rowley wrote:
>> On Fri, 3 Apr 2020 at 17:43, Andrey Lepikhov
>> <a(dot)lepikhov(at)postgrespro(dot)ru> wrote:
>> Doing thing the way I describe will allow you to get rid of all the
>> UniqueRelInfo stuff.
> Thanks for the review and sorry for the late reply.
> I fixed small mistakes, mentioned in your letter.
> Also I rewrote this patch at your suggestion [1].
> Because of many changes, this patch can be viewed as a sketch.
> To change self-join detection algorithm I used your delta patch from
> [2]. I added in the split_selfjoin_quals routine complex expressions
> handling for demonstration. But, it is not very useful with current
> infrastructure, i think.
> Also I implemented one additional way for self-join detection
> algorithm: if the join target list isn't contained vars from inner
> relation, then we can detect self-join with only quals like a1.x=a2.y
> if check innerrel_is_unique is true.
> Analysis of the target list is contained in the new routine -
> tlist_contains_rel_exprs - rewritten version of the
> build_joinrel_tlist routine.
> Also changes of the join_is_removable() routine is removed from the
> patch. I couldn't understand why it is needed here.
> Note, this patch causes change of one join.sql regression test output.
> It is not a bug, but maybe fixed.
> Applied over commit 4a071afbd0.
> > [1]
> [2]
Status update for a commitfest entry.

This entry was "Waiting on author" during this CF. As I see, the latest
message contains new version of the patch. Does it need more work? Are
you going to continue working on it?

Anastasia Lubennikova
Postgres Professional:
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message 2020-11-27 09:23:11 RE: Disable WAL logging to speed up data loading
Previous Message Alexander Korotkov 2020-11-27 09:13:48 Re: [HACKERS] [PATCH] Generic type subscripting