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

Re: "analyze" putting wrong reltuples in pg_class

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ron Mayer <ron(at)intervideo(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: "analyze" putting wrong reltuples in pg_class
Date: 2002-08-02 22:50:44
Message-ID: 28671.1028328644@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Ron Mayer <ron(at)intervideo(dot)com> writes:
> On a number of my tables, "analyze" seems to be putting the wrong value of
> "reltuples" in pg_class.  "vacuum" seems to be doing the right thing.

Hmm.  analyze by itself generates only an approximate estimate of the
row count (since it only examines a random sample of the rows).  But I'd
not have expected it to be off by a factor of 200.  Need more info.
What does VACUUM VERBOSE show?  Also, it would be interesting to see
what contrib/pgstattuple shows, if you can run that conveniently.
Can you say anything about your typical usage pattern on these tables?
(eg, numbers of inserts vs updates vs deletes)

BTW, it's quite likely that VACUUM FULL will make the problem go away,
so don't do that until we fully understand what's happening ...

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Ron MayerDate: 2002-08-03 01:21:03
Subject: Re: "analyze" putting wrong reltuples in pg_class
Previous:From: pgsql-bugsDate: 2002-08-02 22:02:35
Subject: Bug #729: replacing a function used in an index yields incorrect query results.

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