Re: Removing unneeded self joins

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>, Richard Guo <guofenglinux(at)gmail(dot)com>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, "Gregory Stark (as CFM)" <stark(dot)cfm(at)gmail(dot)com>, Michał Kłeczek <michal(at)kleczek(dot)org>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Subject: Re: Removing unneeded self joins
Date: 2025-07-15 22:29:35
Message-ID: CAPpHfdsZvamg7XonkdkoYzBHcT0+7NVtM1wazt_zOVC6ACyE0Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 16, 2025 at 1:16 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> On Wed, Jul 16, 2025 at 12:38:58AM +0300, Alexander Korotkov wrote:
> > I recently got notification this is in Open Items.
> > https://wiki.postgresql.org/wiki/PostgreSQL_18_Open_Items
> > What is your opinion on this: do we need additional hook, fair to
> > leave this "as is" or another option?
>
> I'm OK with the statu-quo on my side when it comes to plan hinting.
> With the GUC workaround, it's still possible to get through so it is
> not like we don't have any options. The point about other extensions
> still stands, I think, but perhaps we are OK even on these fronts as
> the join search hook is far from being the most popular one AFAIK.
>
> So dropping the item and do nothing is a fine answer.

OK, thank you for your feedback. I've searched GitHub for other users
of join_search_hook. A couple of interesting use cases I found are
the following.
https://github.com/wulczer/saio
https://github.com/ashenBlade/pg_dphyp
But they provide alternative join optimization algorithms. So, in
spite of pg_hint_plan they are probably OK to optimize whatever joins
are left. Thus, it's not yet clear whether this issue affects anybody
else. I've moved this item into the "non-bugs" list, but I'm OK to
re-open it if there are other affected extensions.

------
Regards,
Alexander Korotkov
Supabase

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-07-15 22:31:25 Re: libpq: Process buffered SSL read bytes to support records >8kB on async API
Previous Message Michael Paquier 2025-07-15 22:16:32 Re: Removing unneeded self joins