Re: Rename EXISTS-to-ANY converted subplan to exists_to_any

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: solai v <solai(dot)cdac(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Rename EXISTS-to-ANY converted subplan to exists_to_any
Date: 2026-07-24 17:12:56
Message-ID: 20260725021256.6d3b94ce3b3f9ea50a2a6155@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 17 Jul 2026 16:40:29 +0530
solai v <solai(dot)cdac(at)gmail(dot)com> wrote:

> I tested this patch on the current HEAD.
> Before applying the patch, I observed that the converted subplan was
> displayed with the exists_ prefix in the EXPLAIN output.
> For example:
> Filter: ((ANY (a = (hashed SubPlan exists_2).col1)) OR (a < 0))
> SubPlan exists_2
> Even though the planner had internally converted the simple EXISTS
> subquery into an ANY subplan, the displayed name still used the
> exists_ prefix, which could be a little confusing when reading the
> execution plan.
>
> After applying the patch, the same query produced:
> Filter: ((ANY (a = (hashed SubPlan exists_to_any_1).col1)) OR (a < 0))
> SubPlan exists_to_any_1
> The new name makes it much clearer that this subplan is the result of
> an EXISTS-to-ANY conversion.
>
> I also verified that the query executed successfully before and after
> applying the patch. I didn't notice any change in the execution plan
> or query results ,the only visible difference was the improved subplan
> naming in the EXPLAIN output.
> Overall, the patch improves the readability of the user-visible plan
> without changing planner behavior.

Hi Solai, Robert,

Thank you, Solai, for testing the patch and confirming the results.
It is good to hear that the change improves the readability of the
EXPLAIN output as intended.

Robert, do you have a chance to review this? As Tom and Fujii-san
suggested, we'd like to get this into v19 to keep the naming consistent.
If you don't have any objections, we'd like to move forward with this patch.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2026-07-24 17:50:23 Re: pg_class.reltuples can become non-finite and never recovers
Previous Message Yugo Nagata 2026-07-24 16:48:32 Re: Track skipped tables during autovacuum and autoanalyze