Thread: pgsql: Remove more redundant relation locking during executor startup.

pgsql: Remove more redundant relation locking during executor startup.

From
Tom Lane
Date:
Remove more redundant relation locking during executor startup.

We already have appropriate locks on every relation listed in the
query's rangetable before we reach the executor.  Take the next step
in exploiting that knowledge by removing code that worries about
taking locks on non-leaf result relations in a partitioned table.

In particular, get rid of ExecLockNonLeafAppendTables and a stanza in
InitPlan that asserts we already have locks on certain such tables.

In passing, clean up some now-obsolete comments in InitPlan.

Amit Langote, reviewed by David Rowley and Jesper Pedersen,
and whacked around a bit more by me

Discussion: https://postgr.es/m/468c85d9-540e-66a2-1dde-fec2b741e688@lab.ntt.co.jp

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execMain.c        | 56 ++++++++-----------------------
src/backend/executor/execUtils.c       | 60 ----------------------------------
src/backend/executor/nodeAppend.c      |  6 ----
src/backend/executor/nodeMergeAppend.c |  6 ----
src/include/executor/executor.h        |  2 --
5 files changed, 14 insertions(+), 116 deletions(-)