Re: BUG #19692: Generic partition-pruning plan delays statement_timeout cancellation - Mailing list pgsql-bugs

From David Rowley
Subject Re: BUG #19692: Generic partition-pruning plan delays statement_timeout cancellation
Date
Msg-id CAApHDvpjDe2x+i0ineTAP959m=SwCCnF92svh9sQAO6TPvuSbg@mail.gmail.com
Whole thread
In response to BUG #19692: Generic partition-pruning plan delays statement_timeout cancellation  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Thu, 17 Sept 2026 at 22:23, PG Bug reporting form
<noreply@postgresql.org> wrote:
> Generating a fresh generic plan for a range-partitioned table with 18
> partition keys and two parameterized lower-bound clauses per key delays
> statement_timeout cancellation. With statement_timeout set to 50 ms,
> cancellation was not reported until 315–346 ms after the statement began.
> The issue is localized to planning, and the backend remains healthy
> afterward.

There is nothing specifically slow about generating steps for a
partitioned table with exactly 18 partition keys. The point of
interest here is that the step generation can take a long time when
there are many partition keys and the query is complex.

I've pushed a patch that adds a CHECK_FOR_INTERRUPTS() in
get_steps_using_prefix_recurse().

David.



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #19695: JSON_VALUE ... RETURNING jsonb returns NULL for later evaluation once one evaluation returns NULL
Next
From: PG Bug reporting form
Date:
Subject: BUG #19696: DISTINCT ON with a target-list set-returning function causes a 1000-fold selectivity underestimate