Skip site navigation (1) Skip section navigation (2)

Re: Where does data in pg_stat_user_tables come from?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Where does data in pg_stat_user_tables come from?
Date: 2010-09-16 19:14:34
Message-ID: 5576.1284664474@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> It's been pure nonsense in this thread.  Please show an example of
>> what's not working.

> 1) Init a postgresql 8.3 with autovacuum disabled.

> 2) Load a backup of a database into that PostgreSQL.

> 3) Check pg_stat_user_tables.  n_live_tup for all tables will be 0.

Really?  It works for me.  You sure this installation hasn't got stats
disabled?  Check the beginning of the postmaster log to see if there
are any bleats about failing to start the stats collector.

> 4) VACUUM ANALYZE the whole database.

> 5) n_live_tup will *still* be 0.  Whereas reltuples in pg_class will be
> reasonable accurate.

It's possible you are seeing the effects of the fact that pre-9.0,
vacuum and analyze wouldn't create a stats entry for a table that
didn't have one already.  However, it's entirely not clear why you
wouldn't have one already.  Also, if you didn't, you wouldn't see any
row at all in the pg_stat_user_tables, not a row with n_live_tup = 0.

In any case, it's clear that your installation is not operating as
intended, and as 8.3 does work for me here.  Better look for something
interfering with stats collection.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2010-09-16 19:34:29
Subject: Re: Where does data in pg_stat_user_tables come from?
Previous:From: Guillaume LelargeDate: 2010-09-16 19:02:07
Subject: Re: Where does data in pg_stat_user_tables come from?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group