pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Where does data in pg_stat_user_tables come from?
Date: Thu, 16 Sep 2010 15:14:34 -0400
Message-ID: <5576.1284664474@sss.pgh.pa.us> (raw)
In-Reply-To: <4C92645A.1040208@agliodbs.com>
References: <4C8EAE5E.70201@agliodbs.com>
	<1284421288.28610.501.camel@jd-desktop.unknown.charter.com>
	<4C8EB813.6070204@agliodbs.com>
	<1284423128.28610.592.camel@jd-desktop.unknown.charter.com>
	<4C8EC79F.9080404@agliodbs.com>
	<1284436337-sup-9871@alvh.no-ip.org>
	<4C92645A.1040208@agliodbs.com>

Josh Berkus <josh@agliodbs.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



view thread (11+ messages)  latest in thread

Message-ID: <5576.1284664474@sss.pgh.pa.us>
Permalink:  ../5576.1284664474@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5576.1284664474@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, josh@agliodbs.com
  Subject: Re: Where does data in pg_stat_user_tables come from?
  In-Reply-To: <5576.1284664474@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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