pgsql: pg_plan_advice: Add CHECK_FOR_INTERRUPTS() and check_stack_depth
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: /messages/by-id/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(+)