some broken on pg_stat_user_functions
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
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
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
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
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