aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-03-24 17:07:14 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-03-24 17:07:22 -0400
commit3c05284d83b230728e59a25e828992037ef77096 (patch)
tree4e8ef1779b279c01ac28413f1ea7fccbcac9ed7f /src/backend/executor/execMain.c
parent5b140dc8f094e8a11fccab6bdee50d4c599e7444 (diff)
downloadpostgresql-3c05284d83b230728e59a25e828992037ef77096.tar.gz
postgresql-3c05284d83b230728e59a25e828992037ef77096.zip
Invent GENERIC_PLAN option for EXPLAIN.
This provides a very simple way to see the generic plan for a parameterized query. Without this, it's necessary to define a prepared statement and temporarily change plan_cache_mode, which is a bit tedious. One thing that's a bit of a hack perhaps is that we disable execution-time partition pruning when the GENERIC_PLAN option is given. That's because the pruning code may attempt to fetch the value of one of the parameters, which would fail. Laurenz Albe, reviewed by Julien Rouhaud, Christoph Berg, Michel Pelletier, Jim Jones, and myself Discussion: https://postgr.es/m/0a29b954b10b57f0d135fe12aa0909bd41883eb0.camel@cybertec.at
Diffstat (limited to 'src/backend/executor/execMain.c')
-rw-r--r--src/backend/executor/execMain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index b32f419176c..1b007dc32cd 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -911,7 +911,7 @@ InitPlan(QueryDesc *queryDesc, int eflags)
* prepared to handle REWIND efficiently; otherwise there is no need.
*/
sp_eflags = eflags
- & (EXEC_FLAG_EXPLAIN_ONLY | EXEC_FLAG_WITH_NO_DATA);
+ & ~(EXEC_FLAG_REWIND | EXEC_FLAG_BACKWARD | EXEC_FLAG_MARK);
if (bms_is_member(i, plannedstmt->rewindPlanIDs))
sp_eflags |= EXEC_FLAG_REWIND;