Re: EXPLAIN doesn't show the actual function expression for FunctionScan

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 14:40:30
Message-ID: 28689.1282660830@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
report. Seems like this would be a good thing to print. Should
it appear always, or just with VERBOSE, or ???

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 14:56:07
Message-ID: 20100824145607.GB5259@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 10:40:30AM -0400, Tom Lane wrote:
> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
> report. Seems like this would be a good thing to print. Should
> it appear always, or just with VERBOSE, or ???

+1 for always.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 14:56:20
Message-ID: AANLkTik7reoUr6P8HQGFjWeFwU9z+_RFBm1NSyMs_53X@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 10:40 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
> report.  Seems like this would be a good thing to print.  Should
> it appear always, or just with VERBOSE, or ???

I think showing it always is reasonable. I'd like to see it printed
in a form such that casting to regproc will succeed.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 14:59:40
Message-ID: AANLkTi=JWxKv94BJ+ZSpsF5-p86NBgoRq9SefxDyq3vq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 10:56 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Tue, Aug 24, 2010 at 10:40 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
>> report.  Seems like this would be a good thing to print.  Should
>> it appear always, or just with VERBOSE, or ???
>
> I think showing it always is reasonable.  I'd like to see it printed
> in a form such that casting to regproc will succeed.

On second thought, that second sentence may not make sense. What
exactly did you have in mind for this to look like?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:06:02
Message-ID: 29138.1282662362@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Aug 24, 2010 at 10:56 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>> I think showing it always is reasonable. I'd like to see it printed
>> in a form such that casting to regproc will succeed.

> On second thought, that second sentence may not make sense.

It does not, because it's not the *name* of the function that I care
about --- it's the actual executable expression including arguments.

> What exactly did you have in mind for this to look like?

Wheeler's example involves

select ... from unnest(array[blah blah blah])

and I'd like it to regurgitate the whole unnest(array[blah blah blah])
expression. Not sure how to label it exactly. Right now you only see

Function Scan on unnest f (cost=0.00..1.50 rows=100 width=96)

or with VERBOSE, it'll give you some info about the targetlist (the ...
above), but still nothing about the FROM expression.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:24:59
Message-ID: AANLkTikmg4pU4vZaQ5sAsZNfRXbmWLAxspzJafwWmBSj@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 11:06 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Tue, Aug 24, 2010 at 10:56 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> I think showing it always is reasonable.  I'd like to see it printed
>>> in a form such that casting to regproc will succeed.
>
>> On second thought, that second sentence may not make sense.
>
> It does not, because it's not the *name* of the function that I care
> about --- it's the actual executable expression including arguments.
>
>> What exactly did you have in mind for this to look like?
>
> Wheeler's example involves
>
>        select ... from unnest(array[blah blah blah])
>
> and I'd like it to regurgitate the whole unnest(array[blah blah blah])
> expression.  Not sure how to label it exactly.  Right now you only see
>
>  Function Scan on unnest f  (cost=0.00..1.50 rows=100 width=96)
>
> or with VERBOSE, it'll give you some info about the targetlist (the ...
> above), but still nothing about the FROM expression.

If you try to put all that on the same line, I think it might get
awkwardly long. Perhaps something like:

Function Scan on function_name
Expression: function_name(function_arg1, function_arg2, ...)

?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:27:45
Message-ID: 201008241727.45792.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi,

On Tuesday 24 August 2010 16:40:30 Tom Lane wrote:
> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
> report. Seems like this would be a good thing to print. Should
> it appear always, or just with VERBOSE, or ???
I vote for only showing it with verbose - not that its a new problem, but too
long argument lists (arrays) you could make otherwise readable plans
unreadable.

Andres


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:35:35
Message-ID: 29711.1282664135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> If you try to put all that on the same line, I think it might get
> awkwardly long. Perhaps something like:

> Function Scan on function_name
> Expression: function_name(function_arg1, function_arg2, ...)

Yeah, that's what I had in mind, but I'm still fumbling for the right
label. "Expression" seems a bit too generic.

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:36:50
Message-ID: 29749.1282664210@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On Tuesday 24 August 2010 16:40:30 Tom Lane wrote:
>> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
>> report. Seems like this would be a good thing to print. Should
>> it appear always, or just with VERBOSE, or ???

> I vote for only showing it with verbose

That'd be fine with me. The lack of prior complaints suggests that
most of the time people don't need it.

regards, tom lane


From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 15:39:54
Message-ID: 201008241739.54376.andres@anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tuesday 24 August 2010 17:36:50 Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On Tuesday 24 August 2010 16:40:30 Tom Lane wrote:
> >> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
> >> report. Seems like this would be a good thing to print. Should
> >> it appear always, or just with VERBOSE, or ???
> >
> > I vote for only showing it with verbose
>
> That'd be fine with me. The lack of prior complaints suggests that
> most of the time people don't need it.
I personally missed it but never got around to complain/do something.

Andres


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 16:02:03
Message-ID: 1282664935-sup-4334@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Tom Lane's message of mar ago 24 11:36:50 -0400 2010:
> Andres Freund <andres(at)anarazel(dot)de> writes:
> > On Tuesday 24 August 2010 16:40:30 Tom Lane wrote:
> >> So I got annoyed by $SUBJECT just now while chasing Wheeler's bug
> >> report. Seems like this would be a good thing to print. Should
> >> it appear always, or just with VERBOSE, or ???
>
> > I vote for only showing it with verbose
>
> That'd be fine with me. The lack of prior complaints suggests that
> most of the time people don't need it.

Yeah, and if the expression is large, it could get cumbersome (consider
crosstab functions which are often called with large gobs of text). On
the other hand, the same case makes it very useful to have the text for
further research on query behavior.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 16:06:34
Message-ID: 619.1282665994@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> If you try to put all that on the same line, I think it might get
>> awkwardly long. Perhaps something like:

>> Function Scan on function_name
>> Expression: function_name(function_arg1, function_arg2, ...)

> Yeah, that's what I had in mind, but I'm still fumbling for the right
> label. "Expression" seems a bit too generic.

How about "Function Call"?

A moment's hacking later:

regression=# explain verbose SELECT lv|| op|| rv FROM unnest(ARRAY[
ROW('1.2.2'::semver, '='::text, '1.2.2'::semver),
ROW('1.2.23', '=', '1.2.23')
]) AS f(lv semver, op text, rv semver);
QUERY PLAN
--------------------------------------------------------------------------------------------------------------------------------
Function Scan on pg_catalog.unnest f (cost=0.00..1.50 rows=100 width=96)
Output: (((lv)::text || op) || (rv)::text)
Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])
(3 rows)

Look reasonable?

regards, tom lane


From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 17:03:45
Message-ID: 20100824170345.GA21687@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 12:06:34PM -0400, Tom Lane wrote:
> I wrote:
> > Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> >> If you try to put all that on the same line, I think it might get
> >> awkwardly long. Perhaps something like:
>
> >> Function Scan on function_name
> >> Expression: function_name(function_arg1, function_arg2, ...)
>
> > Yeah, that's what I had in mind, but I'm still fumbling for the right
> > label. "Expression" seems a bit too generic.
>
> How about "Function Call"?
>
> A moment's hacking later:
>
> regression=# explain verbose SELECT lv|| op|| rv FROM unnest(ARRAY[
> ROW('1.2.2'::semver, '='::text, '1.2.2'::semver),
> ROW('1.2.23', '=', '1.2.23')
> ]) AS f(lv semver, op text, rv semver);
> QUERY PLAN
> --------------------------------------------------------------------------------------------------------------------------------
> Function Scan on pg_catalog.unnest f (cost=0.00..1.50 rows=100 width=96)
> Output: (((lv)::text || op) || (rv)::text)
> Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])
> (3 rows)
>
> Look reasonable?

This would have helped me a good deal a couple of times this week :)

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 17:13:27
Message-ID: AANLkTi=8RKW0s5P8dJ0kZwBeL1otuJ9ST5W7_HjDEC32@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 5:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>  Function Scan on pg_catalog.unnest f  (cost=0.00..1.50 rows=100 width=96)
>   Output: (((lv)::text || op) || (rv)::text)
>   Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])

This may be the ultimate bike-shed but Wouldn't this be clearer the
other way around? I generally think input comes first and then output.

On the other hand the plan tree does read from bottom up with the
outputs going up to the next level up.

--
greg


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 17:21:22
Message-ID: 1737.1282670482@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> On Tue, Aug 24, 2010 at 5:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Function Scan on pg_catalog.unnest f (cost=0.00..1.50 rows=100 width=96)
>> Output: (((lv)::text || op) || (rv)::text)
>> Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])

> This may be the ultimate bike-shed but Wouldn't this be clearer the
> other way around? I generally think input comes first and then output.

The order was bothering me a bit too, but there's a generic decision
in there that the tlist is shown before any node-type-specific items.
Not sure that we want to move it to the bottom for all of them.

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 17:34:10
Message-ID: AANLkTikmRHeTCJK7vUOdG1fYoep_H8BpFs7HMrnNSZo0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Tue, Aug 24, 2010 at 1:21 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Greg Stark <gsstark(at)mit(dot)edu> writes:
>> On Tue, Aug 24, 2010 at 5:06 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>  Function Scan on pg_catalog.unnest f  (cost=0.00..1.50 rows=100 width=96)
>>>   Output: (((lv)::text || op) || (rv)::text)
>>>   Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])
>
>> This may be the ultimate bike-shed but Wouldn't this be clearer the
>> other way around? I generally think input comes first and then output.
>
> The order was bothering me a bit too, but there's a generic decision
> in there that the tlist is shown before any node-type-specific items.
> Not sure that we want to move it to the bottom for all of them.

I don't think we do. Although, it has seemed to me at times that we
might want to have "output" be controlled by its own EXPLAIN option.

EXPLAIN (VERBOSE on, OUTPUT off) ...

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 18:23:28
Message-ID: 0867B155-4D64-4389-84A7-01FDDC98B9FF@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Aug 24, 2010, at 10:21 AM, Tom Lane wrote:

>> This may be the ultimate bike-shed but Wouldn't this be clearer the
>> other way around? I generally think input comes first and then output.
>
> The order was bothering me a bit too, but there's a generic decision
> in there that the tlist is shown before any node-type-specific items.
> Not sure that we want to move it to the bottom for all of them.

Does it make a difference for the other ouputs (JSON, YAML, XML)?

Best,

David


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-24 18:31:01
Message-ID: 2740.1282674661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"David E. Wheeler" <david(at)kineticode(dot)com> writes:
> On Aug 24, 2010, at 10:21 AM, Tom Lane wrote:
>> The order was bothering me a bit too, but there's a generic decision
>> in there that the tlist is shown before any node-type-specific items.
>> Not sure that we want to move it to the bottom for all of them.

> Does it make a difference for the other ouputs (JSON, YAML, XML)?

It shouldn't should it? The order of fields in a node should not
matter too much for any readers of those formats.

regards, tom lane


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-25 07:58:25
Message-ID: 36CE8AEB-A9D7-4373-8312-6ADC74196053@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Argument List?

--
dim

Le 24 août 2010 à 18:06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> a écrit :

> I wrote:
>> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>>> If you try to put all that on the same line, I think it might get
>>> awkwardly long. Perhaps something like:
>
>>> Function Scan on function_name
>>> Expression: function_name(function_arg1, function_arg2, ...)
>
>> Yeah, that's what I had in mind, but I'm still fumbling for the right
>> label. "Expression" seems a bit too generic.
>
> How about "Function Call"?
>
> A moment's hacking later:
>
> regression=# explain verbose SELECT lv|| op|| rv FROM unnest(ARRAY[
> ROW('1.2.2'::semver, '='::text, '1.2.2'::semver),
> ROW('1.2.23', '=', '1.2.23')
> ]) AS f(lv semver, op text, rv semver);
> QUERY PLAN
> --------------------------------------------------------------------------------------------------------------------------------
> Function Scan on pg_catalog.unnest f (cost=0.00..1.50 rows=100 width=96)
> Output: (((lv)::text || op) || (rv)::text)
> Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])
> (3 rows)
>
> Look reasonable?
>
> regards, tom lane
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-25 14:18:38
Message-ID: 19397.1282745918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Dimitri Fontaine <dfontaine(at)hi-media(dot)com> writes:
> Argument List?

Well, as shown in the example I posted, it's not just the argument list
but the whole call:

>> Function Call: unnest(ARRAY[ROW(('1.2.2'::text)::semver, '='::text, ('1.2.2'::text)::semver), ROW('1.2.23', '=', '1.2.23')])

Now you might suggest that the function itself is redundant with the
information given in the FunctionScan node line and so we need only
show the argument list. Unfortunately there are cases where this fails;
in particular, the named function could have been "inlined" by the
planner, meaning that the actual expression could be just about anything
at all. So I think that trying to be cute is a bad idea and we should
just print the nodetree as-is.

regards, tom lane


From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers\(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN doesn't show the actual function expression for FunctionScan
Date: 2010-08-26 09:54:49
Message-ID: 877hjd66mu.fsf@hi-media-techno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> Now you might suggest that the function itself is redundant with the
> information given in the FunctionScan node line and so we need only
> show the argument list. Unfortunately there are cases where this fails;
> in particular, the named function could have been "inlined" by the
> planner, meaning that the actual expression could be just about anything
> at all. So I think that trying to be cute is a bad idea and we should
> just print the nodetree as-is.

Oh. +1 then.

Regards,
--
dim