X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id BC31B476355 for ; Tue, 8 Apr 2003 13:44:09 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 927A2476374 for ; Tue, 8 Apr 2003 13:44:04 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 7052D43A89E; Tue, 8 Apr 2003 13:44:04 -0400 (EDT) From: Jeff Boes X-Newsgroups: comp.databases.postgresql.admin Subject: pg_class.reltuples not reset by VACUUM? Date: Tue, 08 Apr 2003 13:46:49 -0400 Organization: Nexcerpt, Inc. Lines: 45 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 X-Complaints-To: usenet@news.hub.org User-Agent: Pan/0.11.4 (Unix) X-Comment-To: ALL To: pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-5.8 required=5.0 tests=BAYES_10,USER_AGENT version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/100 X-Sequence-Number: 8255 I thought that VACUUM ANALYZE would always restore some sense of reality to the internal statistics for a table. However ... # select count(*) from job_queue; count=20 ------- 834 (1 row) # select reltuples from pg_class where relname =3D 'job_queue'; reltuples=20 ----------- 206277 (1 row) # vacuum analyze job_queue; # select reltuples from pg_class where relname =3D 'job_queue'; reltuples=20 ----------- 2062xx (slightly larger number) (1 row) This is of concern to me mostly because: # explain select * from job_queue; =20=20=20=20=20=20=20=20=20=20=20=20=20 NOTICE: QUERY PLAN: Seq Scan on job_queue (cost=3D0.00..5989.77 rows=3D206277 width=3D95) Obviously, the optimizer thinks that the table has 200k rows in it! --=20 Jeff Boes vox 616.226.9550 ext 24 Database Engineer fax 616.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt... Extend your Expertise