Re: Questions about the internal of fastpath function call

From: lee Richard <clipper(dot)kenyon(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Questions about the internal of fastpath function call
Date: 2011-05-08 13:31:26
Message-ID: BANLkTi=2X2Z9yBvSWgWRTYbS9cxhsmRnzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Merlin,

Oh, I didnt realized that it does not support to return scalar, thanks a
lot.

When it returns a single value, I see it use the following function,

SendFunctionCall
result = DatumGetByteaP(FunctionCall1(flinfo, val));

I still can not see how it return a single return value to the client, and
why it call FunctionCall1() again when it want to send the result.

Regards
Clipper

2011/5/8 Merlin Moncure <mmoncure(at)gmail(dot)com>

> On Sun, May 8, 2011 at 8:01 AM, lee Richard <clipper(dot)kenyon(at)gmail(dot)com>
> wrote:
> > Hi,
> >
> > I am reading the source code of fastpath to understand the internal of
> > fastpath. I can not understand how does it send result to the client, I
> hope
> > somebody can help me on this.
> >
> > I see it call it invoke the function in
> >
> > HandleFunctionRequest()
> > -> retval = FunctionCallInvoke(&fcinfo);
> > -> SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat);
> > ->OidOutputFunctionCall()
> > -> OutputFunctionCall()
> > -> result =
> > DatumGetCString(FunctionCall1(flinfo, val));
> > -> result =
> > FunctionCallInvoke(&fcinfo);
> >
> > but I can not see in where it send the tuples to the client, instead it
> > invoke FunctionCallInvoke again. Can anyone tell me how it copy the
> tuples
> > and send it to the client.
>
> It can't: the fastpath function can only return a scalar. See the
> client side docs. The whole system is a kludge more or less.
>
> merlin
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Browne 2011-05-08 14:56:53 Re: Why not install pgstattuple by default?
Previous Message Peter Eisentraut 2011-05-08 12:48:30 Re: Why not install pgstattuple by default?