pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedDatabase stat generation
2+ messages / 2 participants
[nested] [flat]
* Database stat generation
@ 2004-05-31 12:17 Bhanu, Yogesh <yogesh@gsf.de>
0 siblings, 1 reply; 2+ messages in thread
From: Bhanu, Yogesh @ 2004-05-31 12:17 UTC (permalink / raw)
To: pgsql-admin
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 .
Cheers
yogesh
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Database stat generation
@ 2004-06-01 14:46 Bill Montgomery <billm@lulu.com>
parent: Bhanu, Yogesh <yogesh@gsf.de>
0 siblings, 0 replies; 2+ messages in thread
From: Bill Montgomery @ 2004-06-01 14:46 UTC (permalink / raw)
To: Bhanu, Yogesh <yogesh@gsf.de>; +Cc: pgsql-admin
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-06-01 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-05-31 12:17 Database stat generation Bhanu, Yogesh <yogesh@gsf.de>
2004-06-01 14:46 ` Bill Montgomery <billm@lulu.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox