Re: FunctionCallN improvement. - Mailing list pgsql-hackers

From a_ogawa
Subject Re: FunctionCallN improvement.
Date
Msg-id PIEMIKOOMKNIJLLLBCBBGEJLCEAA.a_ogawa@hi-ho.ne.jp
Whole thread Raw
In response to Re: FunctionCallN improvement.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: FunctionCallN improvement.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Based on this I think we ought to go with the "unrolled" approach, ie,
> we'll create a macro to initialize the fixed fields of fcinfo but fill
> in the arg and argisnull arrays with code like what's already in
> FunctionCall2:

I agree. The unrolled approach is a good result in most environments. 

I think that a new macro becomes the following:

#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs) \   do {                                                \
(Fcinfo)->flinfo= Flinfo;                      \       (Fcinfo)->context = NULL;                       \
(Fcinfo)->resultinfo= NULL;                    \       (Fcinfo)->isnull = false;                       \
(Fcinfo)->nargs= Nargs;                        \   } while(0)
 

I think that this macro is effective also in other function such as 
ExecMakeFunctionResultNoSets. However, we should apply that after 
actually examining the effect.

First of all, this macro will be applied only to fmgr.c, but I think 
we better define it in fmgr.h. 

regards,

---
A.Ogawa ( a_ogawa@hi-ho.ne.jp )



pgsql-hackers by date:

Previous
From: Rafael Martinez Guerrero
Date:
Subject: Problems with initdb 8.0.1
Next
From: Tom Lane
Date:
Subject: Re: [NOVICE] Last ID Problem