diff options
| author | Robert Haas <rhaas@postgresql.org> | 2012-02-07 11:23:04 -0500 |
|---|---|---|
| committer | Robert Haas <rhaas@postgresql.org> | 2012-02-07 11:23:04 -0500 |
| commit | af7914c6627bcf0b0ca614e9ce95d3f8056602bf (patch) | |
| tree | 23633b1c4de9e6bbbc9cea30895f8b4ee74e4c01 /src/include | |
| parent | 1631598ea204a3b05104f25d008b510ff5a5c94a (diff) | |
| download | postgresql-af7914c6627bcf0b0ca614e9ce95d3f8056602bf.tar.gz | |
Add TIMING option to EXPLAIN, to allow eliminating of timing overhead.
Sometimes it may be useful to get actual row counts out of EXPLAIN
(ANALYZE) without paying the cost of timing every node entry/exit.
With this patch, you can say EXPLAIN (ANALYZE, TIMING OFF) to get that.
Tomas Vondra, reviewed by Eric Theise, with minor doc changes by me.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/commands/explain.h | 1 | ||||
| -rw-r--r-- | src/include/executor/instrument.h | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/include/commands/explain.h b/src/include/commands/explain.h index 3443259b00..a987c43124 100644 --- a/src/include/commands/explain.h +++ b/src/include/commands/explain.h @@ -31,6 +31,7 @@ typedef struct ExplainState bool analyze; /* print actual times */ bool costs; /* print costs */ bool buffers; /* print buffer usage */ + bool timing; /* print timing */ ExplainFormat format; /* output format */ /* other states */ PlannedStmt *pstmt; /* top of plan */ diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h index 9ecb5445f3..084302e4e7 100644 --- a/src/include/executor/instrument.h +++ b/src/include/executor/instrument.h @@ -31,14 +31,16 @@ typedef struct BufferUsage /* Flag bits included in InstrAlloc's instrument_options bitmask */ typedef enum InstrumentOption { - INSTRUMENT_TIMER = 1 << 0, /* needs timer */ + INSTRUMENT_TIMER = 1 << 0, /* needs timer (and row counts) */ INSTRUMENT_BUFFERS = 1 << 1, /* needs buffer usage */ + INSTRUMENT_ROWS = 1 << 2, /* needs row count */ INSTRUMENT_ALL = 0x7FFFFFFF } InstrumentOption; typedef struct Instrumentation { /* Parameters set at node creation: */ + bool need_timer; /* TRUE if we need timer data */ bool need_bufusage; /* TRUE if we need buffer usage data */ /* Info about current plan cycle: */ bool running; /* TRUE if we've completed first tuple */ |
