Re: pg_plan_advice

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Alexandra Wang <alexandra(dot)wang(dot)oss(at)gmail(dot)com>
Cc: Lukas Fittl <lukas(at)fittl(dot)com>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Dian Fay <di(at)nmfay(dot)com>, Matheus Alcantara <matheusssilv97(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_plan_advice
Date: 2026-02-07 16:25:57
Message-ID: CA+TgmoYbzXRuj5NgQH9gE1tksz3suK0RaES3QKQ=SKqyPi8TPA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the review!

On Mon, Feb 2, 2026 at 2:37 PM Alexandra Wang
<alexandra(dot)wang(dot)oss(at)gmail(dot)com> wrote:
> 0001:
> The code looks good to me. However, I feel a bit uneasy about not
> seeing a test case for the additional subplan origin display added in
> pg_overexplain. Maybe we could add the following test cases to
> exercise that code:

Done.

> 0002:
> Looks good to me.

Cool.

> 0003:
> in accumulate_append_subpath(), but in get_singleton_append_subpath()
> there are only calls to lappend() and no list_concat(). Is that
> intentional? Do we also want to concatenate the newly pulled up
> child_append_relid_sets with the existing ones in
> get_singleton_append_subpath()?

Oh, good catch! Adjusted.

> In add_paths_to_append_rel():
>
> @@ -1785,13 +1790,16 @@ add_paths_to_append_rel(PlannerInfo *root, RelOptInfo *rel,
> {
> Path *path = (Path *) lfirst(l);
> AppendPath *appendpath;
> + AppendPathInput append = {0};
> +
> + append.partial_subpaths = list_make1(path);
> + append.child_append_relid_sets = list_make1(rel->relids);
>
> Could you help me understand why we need to populate
> append.child_append_relid_sets here? I don’t see this child rel being
> pulled up at this point.

Oops, good point. Adjusted this, too.

> 0004:
> I’ve only read through the README and documentation so far; I’ll
> continue reviewing the code in 0004.

Thanks!

I plan to post an updated patch set shortly.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-02-07 16:44:39 Re: pg_plan_advice
Previous Message Robert Haas 2026-02-07 15:54:59 Re: Add 64-bit XIDs into PostgreSQL 15