Re: pg_*_advice: tsv load failure, etc.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_*_advice: tsv load failure, etc.
Date: 2026-09-04 19:40:29
Message-ID: CA+TgmobMLE=ikDkTGPjTHBBF1+9zs8AFUQOeRBasdt7K+VHenw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 3, 2026 at 4:11 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Here it is again, with a second patch to add CHECK_FOR_INTERRUPTS()
> and check_stack_depth() calls.

v3, with more patches.

0001 fixes finding #1 from the original report, namely, that empty
advice string causes a pg_stash_advice.tsv reload failure.

0002 fixes finding #2 from the original report, the lack of
CHECK_FOR_INTERRUPTS() calls inside loops, especially the JOIN_ORDER()
loop. It also adds check_stack_depth() calls in to various recursive
functions.

0003 fixes finding #4 from the original report by documenting the
intended interaction with GEQO and removing the XXX comment from the
README.

0004 fixes a GEQO-related oversight in the original disabled_nodes
patch that could result in the intended behavior from 0003 not holding
in all cases. In principle, this should be back-patched to v18, but
since the non-hacky way of fixing it requires an ABI change and
nobody's complained, I am inclined, at least for now, to fix only v19
and master.

0005 fixes finding #7 form the original report, namely that something
like JOIN_ORDER(f {d1 d2}) tends to get marked /* matched, failed */
rather than /* matched */ even when everything is working. I suppose I
sort of knew about this and thought it wasn't that big of a deal, but
I now think that may have been laziness on my part rather than a
principled position.

There are still some more things to fix here, so I'll keep working on
this next week.

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

Attachment Content-Type Size
v3-0005-pg_plan_advice-Fix-advice-feedback-for-unordered-.patch application/octet-stream 4.9 KB
v3-0002-pg_plan_advice-Add-CHECK_FOR_INTERRUPTS-and-check.patch application/octet-stream 4.3 KB
v3-0003-pg_plan_advice-Document-interaction-with-GEQO.patch application/octet-stream 2.5 KB
v3-0004-Change-GEQO-fitness-comparisons-to-consider-disab.patch application/octet-stream 10.9 KB
v3-0001-pg_stash_advice-Fix-failure-to-reload-empty-advic.patch application/octet-stream 6.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Previous Message Tom Lane 2026-09-04 19:30:38 Re: CREATE SCHEMA ... CREATE DOMAIN support