Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 4AC0112822D8 for ; Wed, 22 Feb 2012 16:53:41 -0400 (AST) Received: from gwmta.wicourts.gov ([165.219.244.99] helo=gw.wicourts.gov) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S0JC0-00066f-3w for pgsql-admin@postgresql.org; Wed, 22 Feb 2012 20:53:41 +0000 Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Wed, 22 Feb 2012 14:53:27 -0600 Message-Id: <4F4501630200002500045A52@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.2 Date: Wed, 22 Feb 2012 14:53:23 -0600 From: "Kevin Grittner" To: "Brian Fehrle" , Subject: Re: WAL files containing old and unmodified data? References: <4F45517F.4050508@consistentstate.com> In-Reply-To: <4F45517F.4050508@consistentstate.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201202/89 X-Sequence-Number: 39149 Brian Fehrle wrote: > I have a very active database that generates between 200 and 400 > WAL files that are archived for backups. Yesterday, the average > number of WAL files being generated skyrocketed. > > We took a look at some WAL files using the strings command, and > notice quite a bit of data from a specific table with timestamps > of last year. This table does some basic tracking, where a row is > inserted, then it's updated, and after that it's never modified > again. So we're having data appear in our WAL files from rows that > haven't (or should not have been) modified at all in over a year. > > We figured that the rows were in fact being updated, so we turned > log_min_duration_statement to 0 for a period of time and monitored > all queries going through, however we never found a single query > that could possibly be updating these pieces of data. > Can server processes such as autovacuum processes cause this > behavior? Yes, to prevent transaction ID wrap-around it must FREEZE each tuple at some point, which is a WAL-logged operation. If many rows were loaded at about the same time, and they were not subsequently updated or deleted, you can see quite a burst of activity when things hit this point. If you're using rsync for your base backups, expect a lot more data to need to be written, too, because tuples which have been stable for the last year have now changed. -Kevin