some broken on pg_stat_user_functions
some broken on pg_stat_user_functions
От:
Pavel 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
Re: some broken on pg_stat_user_functions
От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Pavel Stehule 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
Re: some broken on pg_stat_user_functions
От:
Pavel Stehule <pavel.stehule@gmail.com>
Дата:
2009/2/22 Tom Lane : > Pavel Stehule 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 > regards, tom lane >
Re: some broken on pg_stat_user_functions
От:
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
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index 5cc395e..b7c34c3 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3363,7 +3363,8 @@ COPY postgres_log FROM '/full/path/to/logfile.csv' WITH csv;
Enables tracking of function call counts and time used. Specify
pl to count only procedural language functions,
all to also track SQL and C language functions.
- The default is none.
+ The default is none. Note that inlined SQL
+ functions are not tracked, regardless of the parameter value.
Only superusers can change this setting.
Re: some broken on pg_stat_user_functions
От:
Pavel Stehule <pavel.stehule@gmail.com>
Дата:
2009/2/22 Martin Pihlak : > 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