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/backend/commands/explain.c | |
parent | 85eee28ceca0814384392020c6c9a8269f213510 (diff) | |
download | postgresql-d8b1bf47918aafdc515729624ad1ec2db4b91d14.tar.gz |
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/backend/commands/explain.c')
-rw-r--r-- | src/backend/commands/explain.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c index 02ceedd395..4b2abb9e7b 100644 --- a/src/backend/commands/explain.c +++ b/src/backend/commands/explain.c @@ -7,7 +7,7 @@ * Portions Copyright (c) 1994-5, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.131 2005/03/25 21:57:58 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/explain.c,v 1.132 2005/04/16 20:07:35 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ typedef struct ExplainState static void ExplainOneQuery(Query *query, ExplainStmt *stmt, TupOutputState *tstate); -static double elapsed_time(instr_time * starttime); +static double elapsed_time(instr_time *starttime); static void explain_outNode(StringInfo str, Plan *plan, PlanState *planstate, Plan *outer_plan, @@ -296,7 +296,7 @@ ExplainOnePlan(QueryDesc *queryDesc, ExplainStmt *stmt, { int nt; - if (!rInfo->ri_TrigDesc) + if (!rInfo->ri_TrigDesc || !rInfo->ri_TrigInstrument) continue; for (nt = 0; nt < rInfo->ri_TrigDesc->numtriggers; nt++) { @@ -366,7 +366,7 @@ ExplainOnePlan(QueryDesc *queryDesc, ExplainStmt *stmt, /* Compute elapsed time in seconds since given timestamp */ static double -elapsed_time(instr_time * starttime) +elapsed_time(instr_time *starttime) { instr_time endtime; @@ -663,7 +663,8 @@ explain_outNode(StringInfo str, * We have to forcibly clean up the instrumentation state because * we haven't done ExecutorEnd yet. This is pretty grotty ... */ - InstrEndLoop(planstate->instrument); + if (planstate->instrument) + InstrEndLoop(planstate->instrument); if (planstate->instrument && planstate->instrument->nloops > 0) { |