"analyze" putting wrong reltuples in pg_class

From: Ron Mayer <ron(at)intervideo(dot)com>
To: <pgsql-bugs(at)postgresql(dot)org>
Cc: Ron Mayer <ron(at)intervideo(dot)com>
Subject: "analyze" putting wrong reltuples in pg_class
Date: 2002-08-02 21:36:43
Message-ID: Pine.LNX.4.33.0208021416210.13301-100000@ron
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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=#

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2002-08-02 22:02:35 Bug #729: replacing a function used in an index yields incorrect query results.
Previous Message Tom Lane 2002-08-02 19:35:49 Re: ERROR: scanNameSpaceForRefname: unexpected node type 0