Re: Remove dead macro exec_subplan_get_plan

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Zhang Mingli <zmlpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove dead macro exec_subplan_get_plan
Date: 2022-09-06 02:21:52
Message-ID: CAMbWs4_miCS32tmjFQMKmeE+zA8QFshx6Kyr99fNOwZhA_Ry=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 6, 2022 at 1:18 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Zhang Mingli <zmlpostgres(at)gmail(dot)com> writes:
> > Macro exec_subplan_get_plan is not used anymore.
> > Attach a patch to remove it.
>
> Hm, I wonder why it's not used anymore. Maybe we no longer need
> that list at all? If we do, should use of the macro be
> re-introduced in the accessors?

Seems nowadays no one fetches the Plan from PlannedStmt->subplans with a
certain plan_id any more. Previously back in eab6b8b2 where this macro
was introduced, it was used in explain_outNode and ExecInitSubPlan.

I find a similar macro, planner_subplan_get_plan, who fetches the Plan
from glob->subplans. We can use it in the codes where needed. For
example, in the new function SS_make_multiexprs_unique.

/* Found one, get the associated subplan */
- plan = (Plan *) list_nth(root->glob->subplans, splan->plan_id - 1);
+ plan = planner_subplan_get_plan(root, splan);

Thanks
Richard

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2022-09-06 02:32:42 Re: Reducing the chunk header sizes on all memory context types
Previous Message Thomas Munro 2022-09-06 02:03:52 Re: pg15b3: recovery fails with wal prefetch enabled