some broken on pg_stat_user_functions

Started by Pavel Stehuleabout 17 years ago6 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hello

I am checking this functionality and I am afraid, so option all is broken.

postgres=# select * from pg_stat_user_functions; funcid | schemaname
| funcname | calls | total_time | self_time
--------+------------+----------+-------+------------+-----------
24608 | public | test | 6 | 2002 | 2002
(1 row)

postgres=# create or replace function test(i integer) returns int as
$$begin perform pg_sleep(1);return i; end;$$ language plpgsql;
CREATE FUNCTION
postgres=# create or replace function test1(i integer) returns int as
$$ select $1; $$ language sql;
CREATE FUNCTION
postgres=# select test(10);
test
------
10
(1 row)

postgres=# select test1(10);
test1
-------
10
(1 row)

postgres=# set track_functions to 'all';
SET
postgres=# select test1(10);
test1
-------
10
(1 row)

postgres=# select test(10);
test
------
10
(1 row)

postgres=# select * from pg_stat_user_functions; funcid | schemaname |
funcname | calls | total_time | self_time
--------+------------+----------+-------+------------+-----------
24608 | public | test | 8 | 4003 | 4003
(1 row)

I don't see call test1 :(

regards
Pavel Stehule

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: some broken on pg_stat_user_functions

Pavel Stehule <pavel.stehule@gmail.com> writes:

postgres=# create or replace function test1(i integer) returns int as
$$ select $1; $$ language sql;

This function will get inlined, so there's no separate entity to track
the execution of.

regards, tom lane

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: some broken on pg_stat_user_functions

2009/2/22 Tom Lane <tgl@sss.pgh.pa.us>:

Pavel Stehule <pavel.stehule@gmail.com> writes:

postgres=# create or replace function test1(i integer) returns int as
$$ select $1; $$ language sql;

This function will get inlined, so there's no separate entity to track
the execution of.

then documentation is probably little bit wrong (needs some additional
comment) . This text specifies using option 'all' for sql functions.

regards
Pavel Stehule

Show quoted text

regards, tom lane

#4Martin Pihlak
martin.pihlak@gmail.com
In reply to: Pavel Stehule (#3)
Re: some broken on pg_stat_user_functions

Pavel Stehule wrote:

then documentation is probably little bit wrong (needs some additional
comment) . This text specifies using option 'all' for sql functions.

Attached documentation patch attempts to clarify this.

regards,
Martin

Attachments:

funcstat-doc.patchtext/x-diff; name=funcstat-doc.patchDownload+2-1
#5Pavel Stehule
pavel.stehule@gmail.com
In reply to: Martin Pihlak (#4)
Re: some broken on pg_stat_user_functions

2009/2/22 Martin Pihlak <martin.pihlak@gmail.com>:

Pavel Stehule wrote:

then documentation is probably little bit wrong (needs some additional
comment) . This text specifies using option 'all' for sql functions.

Attached documentation patch attempts to clarify this.

regards,
Martin

thank you
Pavel

#6Tom Lane
tgl@sss.pgh.pa.us
In reply to: Martin Pihlak (#4)
Re: some broken on pg_stat_user_functions

Martin Pihlak <martin.pihlak@gmail.com> writes:

Attached documentation patch attempts to clarify this.

Applied in a slightly modified form.

regards, tom lane