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: Richard Guo <guofenglinux(at)gmail(dot)com>, Lukas Fittl <lukas(at)fittl(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-19 19:46:38
Message-ID: CA+Tgmob7ozJAs5SU6bD2RfAt4w_AmsMGz-aaVA6WeLXHkBypOg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 19, 2026 at 1:53 AM Alexandra Wang
<alexandra(dot)wang(dot)oss(at)gmail(dot)com> wrote:
> I'm about halfway through reviewing 0002 and only now finally
> understand what 0001 is doing. 0001 looks good to me.

Great!

> This took me a bit to work through. I'll send more feedback by the end
> of this week.

Yeah, it's a huge patch. Thanks for having a look through it. I look
forward to your feedback.

Here's v17. I have committed what was previously 0004 (which Richard
reviewed on another thread) so that is dropped from this version. In
addition, this version fixes the last issue that was causing failures
running test_plan_advice with pg_plan_advice.feedback_warnings=on. In
my previous email, I said that I thought the failure in question might
be caused by some undesirable coding in the self-join elimination
code, but that turned out to be incorrect. Instead, the problem was
that pga_identifier.c was using planenr_rt_fetch() in some places, and
it needs to use rt_fetch() everywhere. That's because
planner_rt_fetch() consults simple_rte_array, which both self-join
elimination and join removal can mutate, while rt_fetch() uses the
Query's rtable directly, and that never changes. Since we're trying to
create stable identifiers, "never changes" is what we want. In
addition to changing that, I also cleaned up a few XXX comments.

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

Attachment Content-Type Size
v17-0002-Replace-get_relation_info_hook-with-build_simple.patch application/octet-stream 5.1 KB
v17-0004-Consider-startup-cost-as-a-figure-of-merit-for-p.patch application/octet-stream 17.1 KB
v17-0005-Test-pg_plan_advice-using-a-new-test_plan_advice.patch application/octet-stream 10.5 KB
v17-0001-Allow-extensions-to-mark-an-individual-index-as-.patch application/octet-stream 2.5 KB
v17-0003-Add-pg_plan_advice-contrib-module.patch application/octet-stream 490.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2026-02-19 19:54:23 Re: assume availability of "inline" keyword
Previous Message Robert Haas 2026-02-19 19:29:52 Re: Consider low startup cost in add_partial_path