"analyze" putting wrong reltuples in pg_class - Mailing list pgsql-bugs

From Ron Mayer
Subject "analyze" putting wrong reltuples in pg_class
Date
Msg-id Pine.LNX.4.33.0208021416210.13301-100000@ron
Whole thread Raw
In response to Re: Bug #728: Interactions between bytea and character encoding when doing analyze  (Anders Hammarquist <iko@strakt.com>)
Responses Re: "analyze" putting wrong reltuples in pg_class  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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.

An example of the failure mode is shown below.  Please let me know what
additional info I could supply if more info would help.

  Ron



logs2=# select count(*) from e_ip_full;
  count
---------
 1697755
(1 row)

logs2=# analyze e_ip_full;

logs2=# select relname,reltuples from pg_class where relname = 'e_ip_full';
  relname  | reltuples
-----------+-----------
 e_ip_full |      7555
(1 row)

logs2=# vacuum e_ip_full;
VACUUM
logs2=# select relname,reltuples from pg_class where relname = 'e_ip_full';
  relname  |  reltuples
-----------+-------------
 e_ip_full | 1.69776e+06
(1 row)

logs2=# analyze verbose e_ip_full;
NOTICE:  Analyzing e_ip_full
ANALYZE
logs2=# select relname,reltuples from pg_class where relname = 'e_ip_full';
  relname  | reltuples
-----------+-----------
 e_ip_full |      7555
(1 row)


logs2=# \d e_ip_full;
               Table "e_ip_full"
  Column  |          Type           | Modifiers
----------+-------------------------+-----------
 ip       | character varying(16)   |
 dat      | date                    |
 dom1     | character varying(255)  |
 dom2     | character varying(255)  |
 dom3     | character varying(255)  |
 dom4     | character varying(255)  |
 domn     | character varying(1024) |
 obsolete | boolean                 |
Indexes: e_ip__domain
Unique keys: e_ip__ip_obsolete_dat

logs2=#

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERROR: scanNameSpaceForRefname: unexpected node type 0
Next
From: pgsql-bugs@postgresql.org
Date:
Subject: Bug #729: replacing a function used in an index yields incorrect query results.