diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-16 20:07:35 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-16 20:07:35 +0000 |
commit | d8b1bf47918aafdc515729624ad1ec2db4b91d14 (patch) | |
tree | 666046eec1e911ef6593a5fe6db6b3e938607a73 /src/include/executor | |
parent | 85eee28ceca0814384392020c6c9a8269f213510 (diff) | |
download | postgresql-d8b1bf47918aafdc515729624ad1ec2db4b91d14.tar.gz postgresql-d8b1bf47918aafdc515729624ad1ec2db4b91d14.zip |
Create a new 'MultiExecProcNode' call API for plan nodes that don't
return just a single tuple at a time. Currently the only such node
type is Hash, but I expect we will soon have indexscans that can return
tuple bitmaps. A side benefit is that EXPLAIN ANALYZE now shows the
correct tuple count for a Hash node.
Diffstat (limited to 'src/include/executor')
-rw-r--r-- | src/include/executor/executor.h | 3 | ||||
-rw-r--r-- | src/include/executor/hashjoin.h | 4 | ||||
-rw-r--r-- | src/include/executor/instrument.h | 7 | ||||
-rw-r--r-- | src/include/executor/nodeHash.h | 3 |
4 files changed, 10 insertions, 7 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h index 0d3e18ce0ac..2e42894788e 100644 --- a/src/include/executor/executor.h +++ b/src/include/executor/executor.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.117 2005/03/16 21:38:09 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/executor.h,v 1.118 2005/04/16 20:07:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -105,6 +105,7 @@ extern TupleTableSlot *EvalPlanQual(EState *estate, Index rti, */ extern PlanState *ExecInitNode(Plan *node, EState *estate); extern TupleTableSlot *ExecProcNode(PlanState *node); +extern Node *MultiExecProcNode(PlanState *node); extern int ExecCountSlotsNode(Plan *node); extern void ExecEndNode(PlanState *node); diff --git a/src/include/executor/hashjoin.h b/src/include/executor/hashjoin.h index c0f75922e12..f5200831d7e 100644 --- a/src/include/executor/hashjoin.h +++ b/src/include/executor/hashjoin.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.35 2005/03/06 22:15:05 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/hashjoin.h,v 1.36 2005/04/16 20:07:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ typedef struct HashJoinTableData bool growEnabled; /* flag to shut off nbatch increases */ - bool hashNonEmpty; /* did inner plan produce any rows? */ + double totalTuples; /* # tuples obtained from inner plan */ /* * These arrays are allocated for the life of the hash join, but diff --git a/src/include/executor/instrument.h b/src/include/executor/instrument.h index 0540fd0da71..47899fbcc26 100644 --- a/src/include/executor/instrument.h +++ b/src/include/executor/instrument.h @@ -6,7 +6,7 @@ * * Copyright (c) 2001-2005, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/include/executor/instrument.h,v 1.10 2005/03/25 21:57:59 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/instrument.h,v 1.11 2005/04/16 20:07:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -60,9 +60,9 @@ typedef struct Instrumentation /* Info about current plan cycle: */ bool running; /* TRUE if we've completed first tuple */ instr_time starttime; /* Start time of current iteration of node */ - instr_time counter; /* Accumulates runtime for this node */ + instr_time counter; /* Accumulated runtime for this node */ double firsttuple; /* Time for first tuple of this cycle */ - double tuplecount; /* Tuples so far this cycle */ + double tuplecount; /* Tuples emitted so far this cycle */ /* Accumulated statistics across all completed cycles: */ double startup; /* Total startup time (in seconds) */ double total; /* Total total time (in seconds) */ @@ -73,6 +73,7 @@ typedef struct Instrumentation extern Instrumentation *InstrAlloc(int n); extern void InstrStartNode(Instrumentation *instr); extern void InstrStopNode(Instrumentation *instr, bool returnedTuple); +extern void InstrStopNodeMulti(Instrumentation *instr, double nTuples); extern void InstrEndLoop(Instrumentation *instr); #endif /* INSTRUMENT_H */ diff --git a/src/include/executor/nodeHash.h b/src/include/executor/nodeHash.h index 06d73c060ec..678b2bd7622 100644 --- a/src/include/executor/nodeHash.h +++ b/src/include/executor/nodeHash.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.36 2005/03/06 22:15:05 tgl Exp $ + * $PostgreSQL: pgsql/src/include/executor/nodeHash.h,v 1.37 2005/04/16 20:07:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,6 +19,7 @@ extern int ExecCountSlotsHash(Hash *node); extern HashState *ExecInitHash(Hash *node, EState *estate); extern TupleTableSlot *ExecHash(HashState *node); +extern Node *MultiExecHash(HashState *node); extern void ExecEndHash(HashState *node); extern void ExecReScanHash(HashState *node, ExprContext *exprCtxt); |