From c1352052ef1d4eeb2eb1d822a207ddc2d106cb13 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 17 Mar 2004 01:02:24 +0000 Subject: Replace the switching function ExecEvalExpr() with a macro that jumps directly to the appropriate per-node execution function, using a function pointer stored by ExecInitExpr. This speeds things up by eliminating one level of function call. The function-pointer technique also enables further small improvements such as only making one-time tests once (and then changing the function pointer). Overall this seems to gain about 10% on evaluation of simple expressions, which isn't earthshaking but seems a worthwhile gain for a relatively small hack. Per recent discussion on pghackers. --- src/include/executor/nodeSubplan.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/include/executor/nodeSubplan.h') diff --git a/src/include/executor/nodeSubplan.h b/src/include/executor/nodeSubplan.h index 0335f1ca8c..475a2bb618 100644 --- a/src/include/executor/nodeSubplan.h +++ b/src/include/executor/nodeSubplan.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/executor/nodeSubplan.h,v 1.19 2003/11/29 22:41:01 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/executor/nodeSubplan.h,v 1.20 2004/03/17 01:02:24 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,7 +19,8 @@ extern void ExecInitSubPlan(SubPlanState *node, EState *estate); extern Datum ExecSubPlan(SubPlanState *node, ExprContext *econtext, - bool *isNull); + bool *isNull, + ExprDoneCond *isDone); extern void ExecEndSubPlan(SubPlanState *node); extern void ExecReScanSetParamPlan(SubPlanState *node, PlanState *parent); -- cgit v1.2.1