Re: Convert ALL SubLinks to ANY SubLinks

From: Andrei Lepikhov <lepihov(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Convert ALL SubLinks to ANY SubLinks
Date: 2026-02-26 11:37:15
Message-ID: 0ea8fe57-05c5-428e-936c-fe1dfaed2cc5@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 26/2/26 08:11, Richard Guo wrote:
> Attached is a draft patch illustrating the idea. Any thoughts or
> interest in this transformation?
Thanks for sharing your thoughts.
I want to correct your statement on the 'no regression' phrase. In
practice, users often report issues after each new sublink
transformation goes live.

This happens because the transformation changes the 'join problem'
order. Before, the subplan's join list was handled independently, but
now its relations are mixed with those from higher levels. If the join
collapse limit is exceeded, this can sometimes cause much worse
performance than in earlier Postgres versions.

A recent example of this issue, where a query increased from 9 joins in
PG14 to 18 joins in PG19, can be found in pgsql-performance [1].

[1]
https://www.postgresql.org/message-id/flat/ECA94B5A-E5B4-45F7-B1B4-9BF754083164%40gmx.net

--
regards, Andrei Lepikhov,
pgEdge

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marcos Pegoraro 2026-02-26 11:43:59 Re: Partial Mode in Aggregate Functions
Previous Message Ashutosh Bapat 2026-02-26 11:06:13 Re: SQL Property Graph Queries (SQL/PGQ)