Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DC73DB5DC13 for ; Tue, 27 Sep 2011 11:27:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 62703-03 for ; Tue, 27 Sep 2011 14:27:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from ix.inomial.com (mail.inomial.net [202.62.159.215]) by mail.postgresql.org (Postfix) with ESMTP id 31000B5DC1B for ; Tue, 27 Sep 2011 11:27:45 -0300 (ADT) Received: from [192.168.1.4] (ip-143.29.92.203.VOCUS.net.au [203.92.29.143]) by ix.inomial.com (Postfix) with ESMTPA id ED0BB2C1C79; Wed, 28 Sep 2011 00:27:39 +1000 (EST) Subject: Re: Ineffective autovacuum Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/alternative; boundary="Apple-Mail=_F9753E3C-B966-4254-A25A-224507E797DB" From: Royce Ausburn In-Reply-To: Date: Wed, 28 Sep 2011 00:27:39 +1000 Cc: Tom Lane , pgsql-performance Message-Id: References: <059E65EF-8C66-4DA6-835C-936D6592C94B@inomial.com> <14103.1317097282@sss.pgh.pa.us> <2499AF8B-FB90-40F9-9CF7-5BDC0F33BE6E@inomial.com> To: Marti Raudsepp X-Mailer: Apple Mail (2.1244.3) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201109/394 X-Sequence-Number: 45170 --Apple-Mail=_F9753E3C-B966-4254-A25A-224507E797DB Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 27/09/2011, at 8:29 PM, Marti Raudsepp wrote: > 1. First things first: vacuum cannot delete tuples that are still > visible to any old running transactions. You might have some very long > queries or transactions that prevent it from cleaning properly: >=20 > select * from pg_stat_activity where xact_start < now()-interval '10 = minutes'; Thanks -- that query is very handy. I suspect this might be the cause = of our woes as this query results in a handful of long lived = connections, however they're connections to databases other than the one = that I'm having trouble with. =20 I've checked up on the FSM as you suggested, I don't think that's the = problem as there're no warnings in the verbose output nor the logs. But = another clue: DETAIL: 93 dead row versions cannot be removed yet. After clearing those stuffed transactions vacuum verbose manages to = clear away all the dead rows=85 That's confirmation enough for me - Now = to find the application bugs - Thanks Tom, Marti & Scott for your help! --Royce --Apple-Mail=_F9753E3C-B966-4254-A25A-224507E797DB Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252
1. First things first: vacuum cannot delete tuples = that are still
visible to any old running transactions. You might = have some very long
queries or transactions that prevent it from = cleaning properly:

select * from pg_stat_activity where = xact_start < now()-interval '10 = minutes';

Thanks -- that query = is very handy.  I suspect this might be the cause of our woes as = this query results in a handful of long lived connections, however = they're connections to databases other than the one that I'm having = trouble with.  

I've checked up on the FSM = as you suggested, I don't think that's the problem as there're no = warnings in the verbose output nor the logs.  But another = clue:

DETAIL:  93 dead row versions cannot be removed = yet.

After clearing those stuffed = transactions vacuum verbose manages to clear away all the dead rows=85 = That's confirmation enough for me - Now to find the application bugs = - Thanks Tom, Marti & Scott for your = help!

--Royce

= --Apple-Mail=_F9753E3C-B966-4254-A25A-224507E797DB--