Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id EED6B2E2D45 for ; Wed, 14 Nov 2007 15:21:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12157-03-4 for ; Wed, 14 Nov 2007 15:21:37 -0400 (AST) Received: from relay.icomedias.com (relay.icomedias.com [62.99.232.66]) by postgresql.org (Postfix) with ESMTP id 92BF52E2D47 for ; Wed, 14 Nov 2007 15:21:34 -0400 (AST) Received: from [192.168.0.2] ([10.192.1.228]) by relay.icomedias.com (8.13.7/8.13.7) with ESMTP id lAEJLRpB030559; Wed, 14 Nov 2007 20:21:28 +0100 Message-ID: <473B4AB4.70506@sime.com> Date: Wed, 14 Nov 2007 20:21:24 +0100 From: Mario Weilguni User-Agent: Thunderbird 2.0.0.6 (X11/20070802) MIME-Version: 1.0 To: Jean-David Beyer CC: pgsql performance Subject: Re: Curious about dead rows. References: <4735DBDB.5050208@verizon.net> In-Reply-To: <4735DBDB.5050208@verizon.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.57 on 10.192.64.104 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/218 X-Sequence-Number: 27633 Jean-David Beyer schrieb: > I am doing lots of INSERTs on a table that starts out empty (I did a > TRUNCATE on it). I am not, AFAIK, doing DELETEs or UPDATEs. Autovacuum is > on. I moved logging up to debug2 level to see what was going on, and I get > things like this: > > "vl_as": scanned 3000 of 5296 pages, containing 232944 live rows and 1033 > dead rows; 3000 rows in sample, 411224 estimated total rows > > A little later, it says: > > "vl_as": scanned 3000 of 6916 pages, containing 233507 live rows and 493 > dead rows; 3000 rows in sample, 538311 estimated total rows > > (I suppose that means autovacuum is working.) Is this normal, or have I got > something wrong? Why so many dead rows when just doing inserts? It is not > that I think the number is too high, considering the number of rows in the > table at the point where I copied this line. It is just that I do not > understand why there are any. > > Did you rollback some transactions? It will generate dead rows too - at least I think so.