Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B03112E0171 for ; Thu, 13 Dec 2007 12:27:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 67657-02 for ; Thu, 13 Dec 2007 12:27:11 -0400 (AST) Received: from gwmta.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by postgresql.org (Postfix) with ESMTP id E129C2E08B5 for ; Thu, 13 Dec 2007 12:27:11 -0400 (AST) Received: from Courts-MTA by gwmta.wicourts.gov with Novell_GroupWise; Thu, 13 Dec 2007 10:27:11 -0600 Message-Id: <476108F2.EE98.0025.0@wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 7.0.2 Date: Thu, 13 Dec 2007 10:26:58 -0600 From: "Kevin Grittner" To: "Simon Riggs" Cc: Subject: Re: Heavy write activity on first vacuum of fresh TOAST data References: <4760FF69.EE98.0025.0@wicourts.gov> <1197562283.4255.1829.camel@ebony.site> In-Reply-To: <1197562283.4255.1829.camel@ebony.site> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/187 X-Sequence-Number: 28003 >>> On Thu, Dec 13, 2007 at 10:11 AM, in message <1197562283.4255.1829.camel@ebony.site>, Simon Riggs wrote:=20 > On Thu, 2007-12-13 at 09:46 -0600, Kevin Grittner wrote: > =20 >> The data was inserted through a Java program using a prepared >> statement with no indexes on the table. The primary key was then >> added, and now I've started a vacuum. The new table wound up being >> the first big table vacuumed, and I noticed something odd. Even >> though there have been no rollbacks, updates, or deletes on this >> table, the vacuum is writing as much as it is reading while dealing >> with the TOAST data. >=20 > Writing hint bits. Annoying isn't it? :-( =20 Surprising, anyway. If it allows subsequent operations to be faster, I'll take it; although to a naive user it's not clear what is known at vacuum time that the INSERT into the empty table couldn't have inferred. Bulk loads into empty tables are a pretty common use case, so if there was some way to set the hints on insert, as long as the table started the database transaction empty, nobody else is modifying it, and only inserts have occurred, that would be a good thing. I'm speaking from the perspective of a user, of course; not someone who would actually try to wrangle the code into working that way. =20 Thanks for the explanation. =20 -Kevin =20