Re: improves ExecMakeFunctionResultNoSets

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: improves ExecMakeFunctionResultNoSets
Date: 2005-03-22 20:18:22
Message-ID: 13327.1111522702@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp> writes:
> This patch uses InitFunctionCallInfoData macro instead of MemSet to
> initialize FunctionCallInfoData.
> An idea of this patch discussed in the "FunctionCallN improvement" thread.
> (http://archives.postgresql.org/pgsql-hackers/2005-01/msg01054.php)

Looks good --- applied with minor changes. I figured that if we were
going to make InitFunctionCallInfoData generally available, we had
better fix it to cover initializing the context and resultinfo fields
per caller option. Also cleaned up a couple of other places that
already had hand-optimized calling sequences, and can now be written
more cleanly using the macro. Also, I removed this code you added in
a couple places:

+ /*
+ * argnull is initialized here for safety. Because it might not be
+ * set by ExecEvalExpr.
+ */
+ fcinfo->argnull[i] = false;

If ExecEvalExpr fails to set its isNull argument we will have breakage
all over; there is no need for speed-critical code to assume it has
to do this.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Wong 2005-03-22 22:30:13 Re: WAL: O_DIRECT and multipage-writer
Previous Message a_ogawa 2005-03-22 13:03:39 improves ExecMakeFunctionResultNoSets