OSDN Git Service

Correctly handle planner nesting
authorKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 26 Feb 2019 07:10:29 +0000 (16:10 +0900)
committerKyotaro Horiguchi <horiguchi.kyotaro@lab.ntt.co.jp>
Tue, 26 Feb 2019 11:09:40 +0000 (20:09 +0900)
commit000c325874cc07eb944447d046a122dcc8642520
treeea349022fc0e79fc8720a9cb134d12eeb7e42cc8
parent8241ef0732b65ff8635eb5cc56860b2e9db40ab7
Correctly handle planner nesting

pg_hint_plan assumed that plpgsql is the only source of nested planner
calls. Actually nested call can be made in any shapes. Most of the
cases doesn't harm but in a special case where pg_dbms_stats makes a
SPI call during query planning, that affects subsequent planner
work. Hints lose effect when pg_dbms_stats searches "locked
statistics" tables while planning the target query.

9.5 is not affected. Back patched back to 9.6.
pg_hint_plan.c