Discussion:
statistics collector: number of function calls
(too old to reply)
Markus Bertheau
2004-07-12 15:08:38 UTC
Permalink
Hi,

I'd find it useful if the statistics collector (or someone else) counted
the number of times a function was called (or whether it was called at
all). Given that PL/pgSQL-Functions are compiled only at the first call
this would provide for a possibility to check whether every function has
been used and therefore compiled successfully during a test run of an
application.

Is something like this planned or already available, but hidden well?

Thanks
--
Markus Bertheau <***@bluetwanger.de>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
mike g
2004-07-13 02:43:23 UTC
Permalink
Hello,

It is possible to enable the statements issued against the db to be
logged in postgresql.conf(log_statement = true). Depending on the OS
then you can filter the logs or maybe create a Perl script to scan the
logs.

HTH.
Post by Markus Bertheau
Hi,
I'd find it useful if the statistics collector (or someone else) counted
the number of times a function was called (or whether it was called at
all). Given that PL/pgSQL-Functions are compiled only at the first call
this would provide for a possibility to check whether every function has
been used and therefore compiled successfully during a test run of an
application.
Is something like this planned or already available, but hidden well?
Thanks
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
Markus Bertheau
2004-07-13 08:07:33 UTC
Permalink
Post by mike g
Hello,
It is possible to enable the statements issued against the db to be
logged in postgresql.conf(log_statement = true). Depending on the OS
then you can filter the logs or maybe create a Perl script to scan the
logs.
Does that help when functions call other functions? The second function
will be nowhere in the logs, right?
--
Markus Bertheau <***@bluetwanger.de>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
Mike G
2004-07-14 01:35:39 UTC
Permalink
I believe you are correct. I will check my logs later. If you have access to the code you could add individual sequences within each procedures and use those as counters.
Post by Markus Bertheau
Post by mike g
Hello,
It is possible to enable the statements issued against the db to be
logged in postgresql.conf(log_statement = true). Depending on the OS
then you can filter the logs or maybe create a Perl script to scan the
logs.
Does that help when functions call other functions? The second function
will be nowhere in the logs, right?
--
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
Markus Bertheau
2004-07-14 02:08:22 UTC
Permalink
Post by Mike G
I believe you are correct. I will check my logs later. If you have
access to the code you could add individual sequences within each
procedures and use those as counters.
This is a very odd and costly way, which is why I asked if the
statistics collector couldn't do that job. It's an interesting number.

Is something like that planned in PostgreSQL?

Thanks
--
Markus Bertheau <***@bluetwanger.de>


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ***@postgresql.org)
mike g
2004-07-14 02:46:55 UTC
Permalink
AFAIK nothing along those lines is planned. I have been reading lists
for a few months and nothing in the TODO currently. 7.5 will have more
detail in the logs but probably not what you are looking for.

You can plead your case in the hacker mailing list and perhaps they will
add it to the todo list. A patch would be welcomed as well.

Mike
Post by Markus Bertheau
Post by Mike G
I believe you are correct. I will check my logs later. If you have
access to the code you could add individual sequences within each
procedures and use those as counters.
This is a very odd and costly way, which is why I asked if the
statistics collector couldn't do that job. It's an interesting number.
Is something like that planned in PostgreSQL?
Thanks
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ***@postgresql.org
Loading...