Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ADMIN] Database stat generation

0 views
Skip to first unread message

Bhanu, Yogesh

unread,
May 31, 2004, 8:26:50 AM5/31/04
to
SGVsbG8gIGFkbWlucywNCiAgICAgICAgICAgICAgICAgICAgICAgICBJcyB0
aGVyZSBhbnkgdG9vbCBhdmFpbGFibGUgaW5zaWRlIFBvc3RncmVzIHRvIHRy
YWNrIHdoYXQgZGF0YWJhc2VzIGFyZSBiZWluZyB1c2VkIGFuZCBob3cgLiBJ
dCB3aWxsIGJlIG5pY2UgdG8gZ2VuZXJhdGUgYSBwZXIgZGF0YWJhc2Ugc3Rh
dHMgKEluc2VydHMsIFNlbGVjdCwgRHJvcCkgZm9yIGEgbW9udGggb3IgbW9y
ZSAgYW5kIGFsc28gdHJhY2sgaG93IHRoZSBkYXRhYmFzZSBncmV3IGJpZy9z
bWFsbCAgaW4gdGhlIHNhbWUgdGltZSAuDQogDQpDaGVlcnMNCnlvZ2VzaA0K
Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLShlbmQgb2YgYnJvYWRjYXN0
KS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpUSVAgNzogZG9uJ3QgZm9y
Z2V0IHRvIGluY3JlYXNlIHlvdXIgZnJlZSBzcGFjZSBtYXAgc2V0dGluZ3MK

Bill Montgomery

unread,
Jun 1, 2004, 10:54:00 AM6/1/04
to
Bhanu, Yogesh wrote:

>Hello admins,
> Is there any tool available inside Postgres to track what databases are being used and how . It will be nice to generate a per database stats (Inserts, Select, Drop) for a month or more and also track how the database grew big/small in the same time .
>
>
Yogesh,

First, make sure you have set stats_start_collector and stats_row_level
to true. You may optionally set stats_command_string and
stats_block_level to true for more stats with a correspondingly greater
performance hit. Then, look at some of the pg_stat_* (and pg_statio_* if
you have block level stats turned on) tables/views.

A couple of the most useful tables (to me, anyhow): The pg_class view
has counts of pages and tuples per relation (tables are relkind 'r',
FYI). The pg_stat_database view shows the number of transactions
comitted/rolled back, which is useful to track rates of usage,
especially with a graphing tool like MRTG. To get the number of
inserts/updates/deletes on a table, check out the pg_stat_user_tables view.

For more info, check out the postgres docs on the subject:

http://www.postgresql.org/docs/7.3/interactive/monitoring-stats.html

Regards,

Bill Montgomery

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

0 new messages