aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-09-22 11:29:18 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-09-22 11:30:11 -0400
commitf1972723654947f70409716757aa83f3d93c8fab (patch)
treed4f63965f021b29c30702df069941fb340074dcc /src/include/executor
parent4893552e21b93149bb60f6204673cce855881a05 (diff)
downloadpostgresql-f1972723654947f70409716757aa83f3d93c8fab.tar.gz
postgresql-f1972723654947f70409716757aa83f3d93c8fab.zip
Make EXPLAIN ANALYZE report the numbers of rows rejected by filter steps.
This provides information about the numbers of tuples that were visited but not returned by table scans, as well as the numbers of join tuples that were considered and discarded within a join plan node. There is still some discussion going on about the best way to report counts for outer-join situations, but I think most of what's in the patch would not change if we revise that, so I'm going to go ahead and commit it as-is. Documentation changes to follow (they weren't in the submitted patch either). Marko Tiikkaja, reviewed by Marc Cousin, somewhat revised by Tom
Diffstat (limited to 'src/include/executor')
-rw-r--r--src/include/executor/instrument.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h
index 286cd540632..22c31069436 100644
--- a/src/include/executor/instrument.h
+++ b/src/include/executor/instrument.h
@@ -28,6 +28,7 @@ typedef struct BufferUsage
long temp_blks_written; /* # of temp blocks written */
} BufferUsage;
+/* Flag bits included in InstrAlloc's instrument_options bitmask */
typedef enum InstrumentOption
{
INSTRUMENT_TIMER = 1 << 0, /* needs timer */
@@ -37,9 +38,10 @@ typedef enum InstrumentOption
typedef struct Instrumentation
{
+ /* Parameters set at node creation: */
+ bool need_bufusage; /* TRUE if we need buffer usage data */
/* Info about current plan cycle: */
bool running; /* TRUE if we've completed first tuple */
- bool needs_bufusage; /* TRUE if we need buffer usage */
instr_time starttime; /* Start time of current iteration of node */
instr_time counter; /* Accumulated runtime for this node */
double firsttuple; /* Time for first tuple of this cycle */
@@ -50,6 +52,8 @@ typedef struct Instrumentation
double total; /* Total total time (in seconds) */
double ntuples; /* Total tuples produced */
double nloops; /* # of run cycles for this node */
+ double nfiltered1; /* # tuples removed by scanqual or joinqual */
+ double nfiltered2; /* # tuples removed by "other" quals */
BufferUsage bufusage; /* Total buffer usage */
} Instrumentation;