pgsql: Avoid unnecessary snapshot-acquisitions in BuildCachedPlan.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Avoid unnecessary snapshot-acquisitions in BuildCachedPlan.
Date: 2011-09-25 21:34:31
Message-ID: E1R7wLH-0000sf-Ay@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Avoid unnecessary snapshot-acquisitions in BuildCachedPlan.

I had copied-and-pasted a claim that we couldn't reach this point when
dealing with utility statements, but that was a leftover from when the
caller was required to supply a plan to start with. We now will go
through here at least once when handling a utility statement, so it
seems worth a check to see whether a snapshot is actually needed.
(Note that analyze_requires_snapshot is quite a cheap test.)

Per suggestion from Yamamoto Takashi. I don't think I believe that this
resolves his reported assertion failure; but it's worth changing anyway,
just to save a cycle or two.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d5aa7a9fe68b2017362421bd853faeb8199a472c

Modified Files
--------------
src/backend/utils/cache/plancache.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-09-25 22:53:01 pgsql: Fully const-ify PQconnectdbParams, PQconnectStartParams, and PQp
Previous Message Bruce Momjian 2011-09-25 20:58:18 pgsql: In pgrminclude, document requirement to use pgcompinclude, and s