Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id A45529FB85F for ; Tue, 19 Jun 2007 20:26:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 92563-10 for ; Tue, 19 Jun 2007 20:26:10 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 1E3C49FA26E for ; Tue, 19 Jun 2007 20:26:14 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l5JNQAsV018496; Tue, 19 Jun 2007 19:26:10 -0400 (EDT) To: Kurt Overberg cc: Chris Browne , pgsql-performance@postgresql.org Subject: Re: Maintenance question / DB size anomaly... In-reply-to: References: <607iq0dlns.fsf@dba2.int.libertyrms.com> <1FF54A1D-9085-4C9B-81F3-D860FB132D44@hotdogrecords.com> <16441.1182288819@sss.pgh.pa.us> Comments: In-reply-to Kurt Overberg message dated "Tue, 19 Jun 2007 18:24:21 -0400" Date: Tue, 19 Jun 2007 19:26:10 -0400 Message-ID: <18495.1182295570@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/394 X-Sequence-Number: 25427 Kurt Overberg writes: > That's the thing thats kinda blowing my mind here, when I look at > that table: > db1=# select count(*) from _my_cluster.sl_log_1 ; > count > ------- > 6788 > (1 row) Well, that's real interesting. AFAICS there are only two possibilities: 1. VACUUM sees the other 300k tuples as INSERT_IN_PROGRESS; a look at the code shows that these are counted the same as plain live tuples, but they'd not be visible to other transactions. I wonder if you could have any really old open transactions that might have inserted all those tuples? 2. The other 300k tuples are committed good, but they are not seen as valid by a normal MVCC-aware transaction, probably because of transaction wraparound. This would require the sl_log_1 table to have escaped vacuuming for more than 2 billion transactions, which seems a bit improbable but maybe not impossible. (You did say you were running PG 8.0.x, right? That's the last version without any strong defenses against transaction wraparound...) The way to get some facts, instead of speculating, would be to get hold of the appropriate version of pg_filedump from http://sources.redhat.com/rhdb/ and dump out sl_log_1 with it (probably the -i option would be sufficient), then take a close look at the tuples that aren't visible to other transactions. (You could do "select ctid from sl_log_1" to determine which ones are visible.) regards, tom lane