Two proposals of DBA helper functions

Started by Jean-Paul Argudoover 19 years ago2 messages
#1Jean-Paul Argudo
jean-paul@argudo.org

Hi all,

I would like to submit two ideas:

1/
In the daily tasks I have as (also) a standard DBA, I found usefull to
view locks in a human point of view. I think the "~ '^pg_'" part of the
queries may be not so clean... Any ideas welcome :)

2/
Also, I like having a cache hit/miss ratio. This is why I add a function
"pg_stat_get_db_hit_miss_ratio(database oid)" to pg_stat_database, in a
"bis" view.

Since I dont want to flood the mailing list with a possible useless
thing, I put my sql/plpgsql code here:

http://priam.dalibo.net/~jpa/propositions/

Please take a look at it and tell me if this could be usefull or not..

Thanks a lot,

--
Jean-Paul Argudo
www.postgresqlfr.org
www.dalibo.com

#2Jim C. Nasby
jim@nasby.net
In reply to: Jean-Paul Argudo (#1)
Re: Two proposals of DBA helper functions

On Mon, Sep 25, 2006 at 09:29:28AM +0200, Jean-Paul Argudo wrote:

Hi all,

I would like to submit two ideas:

1/
In the daily tasks I have as (also) a standard DBA, I found usefull to
view locks in a human point of view. I think the "~ '^pg_'" part of the
queries may be not so clean... Any ideas welcome :)

Technically, you need to look and see what schema something is in. Take
a look at how the newsysviews project on pgFoundry does it.

2/
Also, I like having a cache hit/miss ratio. This is why I add a function
"pg_stat_get_db_hit_miss_ratio(database oid)" to pg_stat_database, in a
"bis" view.

Since I dont want to flood the mailing list with a possible useless
thing, I put my sql/plpgsql code here:

http://priam.dalibo.net/~jpa/propositions/

Please take a look at it and tell me if this could be usefull or not..

The general consensus seems to be that the things in pg_catalog should
provide a minimalist view. The newsysviews project was created in the
hope that we could get a more human-friendly version of that data put
into core, but it's been neglected for a while now (for one thing, there
was desire to make it look more like information_schema).
--
Jim Nasby jim@nasby.net
EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)