I like the idea of updating shared memory with the performance statistics, 
current query execution information, etc., providing a function to fetch 
those statistics, and perhaps providing a system view (i.e. pg_performance) 
based upon such functions which can be queried by the administrator.

FWIW,

Mike Mascari
mascarm@mascari.com

-----Original Message-----
From:	Philip Warner [SMTP:pjw@rhyme.com.au]
Sent:	Wednesday, March 07, 2001 7:42 PM
To:	Justin Clift
Cc:	Bruce Momjian; Tom Lane; The Hermit Hacker; PostgreSQL-development
Subject:	Re: [HACKERS] Performance monitor

At 11:33 8/03/01 +1100, Justin Clift wrote:
>Hi all,
>
>Wouldn't another approach be to write a C function that does the
>necessary work, then just call it like any other C function?
>
>i.e.  Connect to the database and issue a "select
>perf_stats('/tmp/stats-2001-03-08-01.txt')" ?
>

I think Bruce wants per-backend data, and this approach would seem to only
get the data for the current backend.

Also, I really don't like the proposal to write files to /tmp. If we want a
perf tool, then we need to have something like 'top', which will
continuously update. With 40 backends, the idea of writing 40 file to /tmp
every second seems a little excessive to me.



----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


Wed, 7 Mar 2001 19:59:20 -0500
Mike Mascari <mascarm@mascari.com>
RE: Performance monitor
At 19:59 7/03/01 -0500, Mike Mascari wrote:
>I like the idea of updating shared memory with the performance statistics, 
>current query execution information, etc., providing a function to fetch 
>those statistics, and perhaps providing a system view (i.e. pg_performance) 
>based upon such functions which can be queried by the administrator.

This sounds like The Way to me. Although I worry that using a view (or
standard libpq methods) might be too expensive in high load situations
(this is not based on any knowledge of the likely costs, however!).

We do need to make this as cheap as possible since we don't want to distort
the stats, and it will often be used to diagnose perormance problems, and
we don't want to contribute to those problems.


----------------------------------------------------------------
Philip Warner                    |     __---_____
Albatross Consulting Pty. Ltd.   |----/       -  \
(A.B.N. 75 008 659 498)          |          /(@)   ______---_
Tel: (+61) 0500 83 82 81         |                 _________  \
Fax: (+61) 0500 83 82 82         |                 ___________ |
Http://www.rhyme.com.au          |                /           \|
                                 |    --________--
PGP key available upon request,  |  /
and from pgp5.ai.mit.edu:11371   |/

Thu, 08 Mar 2001 12:25:59 +1100
Philip Warner <pjw@rhyme.com.au>
RE: Performance monitor