From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change rewriter/planner/executor/plancache to depend on RTE rell
Date: Tue, 02 Oct 2018 18:43:58 +0000
Message-ID: <E1g7PeI-0003ye-T9@gemulon.postgresql.org> (raw)
Change rewriter/planner/executor/plancache to depend on RTE rellockmode.
Instead of recomputing the required lock levels in all these places,
just use what commit fdba460a2 made the parser store in the RTE fields.
This already simplifies the code measurably in these places, and
follow-on changes will remove a bunch of no-longer-needed infrastructure.
In a few cases, this change causes us to acquire a higher lock level
than we did before. This is OK primarily because said higher lock level
should've been acquired already at query parse time; thus, we're saving
a useless extra trip through the shared lock manager to acquire a lesser
lock alongside the original lock. The only known exception to this is
that re-execution of a previously planned SELECT FOR UPDATE/SHARE query,
for a table that uses ROW_MARK_REFERENCE or ROW_MARK_COPY methods, might
have gotten only AccessShareLock before. Now it will get RowShareLock
like the first execution did, which seems fine.
While there's more to do, push it in this state anyway, to let the
buildfarm help verify that nothing bad happened.
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/6e35939febf83069430fedda6f89ab1fbe0f9e10
Modified Files
--------------
src/backend/executor/execMain.c | 14 ++---------
src/backend/executor/execUtils.c | 43 +++++++---------------------------
src/backend/optimizer/prep/prepunion.c | 18 +++-----------
src/backend/rewrite/rewriteHandler.c | 30 ++++++++----------------
src/backend/utils/cache/plancache.c | 37 ++++-------------------------
5 files changed, 27 insertions(+), 115 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Change rewriter/planner/executor/plancache to depend on RTE rell
In-Reply-To: <E1g7PeI-0003ye-T9@gemulon.postgresql.org>
References: <E1g7PeI-0003ye-T9@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox