agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_plan_advice: Add CHECK_FOR_INTERRUPTS() and check_stack_depth
Date: Wed, 09 Sep 2026 22:39:46 +0000
Message-ID: <E1x4QxF-00000004Bl9-1axg@gemulon.postgresql.org> (raw)

pg_plan_advice: Add CHECK_FOR_INTERRUPTS() and check_stack_depth()

Without CHECK_FOR_INTERRUPTS(), backends might not respond to query
cancellations in a timely fashion, especially for JOIN_ORDER()
specifications, where matching against each join can take O(n^2) time
in the length of the join order list in degenerate cases.

Recursive functions should check_stack_depth().

Reported-by: Noah Misch <noah@leadboat.com>
Discussion: https://postgr.es/m/CA+TgmoYmXy-jiP5qDhqNEiYFEBzQsArO6O2d9E8szNZqi1bePQ@mail.gmail.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ddee5d03077c05925e83533e50ebe805c934d2cf

Modified Files
--------------
contrib/pg_plan_advice/pgpa_ast.c     | 14 ++++++++++++++
contrib/pg_plan_advice/pgpa_planner.c |  7 +++++++
contrib/pg_plan_advice/pgpa_trove.c   |  3 +++
3 files changed, 24 insertions(+)



view thread (3+ messages)  latest in thread

Message-ID: <E1x4QxF-00000004Bl9-1axg@gemulon.postgresql.org>
Permalink:  ../E1x4QxF-00000004Bl9-1axg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x4QxF-00000004Bl9-1axg@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pg_plan_advice: Add CHECK_FOR_INTERRUPTS() and check_stack_depth
  In-Reply-To: <E1x4QxF-00000004Bl9-1axg@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox