Thread: No stats visible?

No stats visible?

From
Steve Lane
Date:
Hello all:

I've been looking at Postgres' statistics tables to try to get some sense of
why my database server seems to be running slowly. Oddly, the stats tables
seem to be recording no activity! pg_stat_get_tuples_inserted on one of my
main tables says no tuples have been inserted. I also get lots of zeroes for
all the main numbers on most of the other tables.

The server does get restarted daily but there's definitely been activity
today. Stats logging should be working because I have not changed this in
postgresql.conf and in case I can see the stats-related instances of
postmaster when I look at current processes.

Any ideas?

-- sgl


=======================================================
Steve Lane

Vice President
The Moyer Group
14 North Peoria St Suite 2H

Voice: (312) 433-2421       Email: slane@moyergroup.com
Fax:   (312) 850-3930       Web:   http://www.moyergroup.com
=======================================================


Re: No stats visible?

From
Doug McNaught
Date:
Steve Lane <slane@moyergroup.com> writes:

> Hello all:
>
> I've been looking at Postgres' statistics tables to try to get some sense of
> why my database server seems to be running slowly. Oddly, the stats tables
> seem to be recording no activity! pg_stat_get_tuples_inserted on one of my
> main tables says no tuples have been inserted. I also get lots of zeroes for
> all the main numbers on most of the other tables.

Are you running ANALYZE regularly?  Are you VACUUMing?

-Doug

Re: No stats visible?

From
Tom Lane
Date:
Steve Lane <slane@moyergroup.com> writes:
> I've been looking at Postgres' statistics tables to try to get some sense of
> why my database server seems to be running slowly. Oddly, the stats tables
> seem to be recording no activity!

Did you enable stats collection?
http://www.ca.postgresql.org/users-lounge/docs/7.3/postgres/monitoring-stats.html#MONITORING-STATS-SETUP

            regards, tom lane