It takes about the same time.
Since I do not need statistics on every single test (some of them have data that is not suited for statistical analysis), I modified my schema slightly.
Each test which has to be processed for statistics is tagged as such, reducing the amount of data processed.
With our current data set it went down to from about 30 seconds of execution time to about 2 seconds.
Running this new procedure from pgAdmin and psql yielded approximately the same results (about 2 seconds).
I restarted the pgagent service, and with the new stored procedure it is taking the same amount of time as with direct calls from pgadmin or psql.
So, it appears this was somehow a fluke - go figure. I will monitor this, and if I come across the issue again I will repost.
Yeah - I really can't imagine any reason why it would make any difference. It's the same client library, running a stored proc wiht practically zero I/O!! Oh well...
As always, Thanks for your help.
No problem.
Regards, Dave.