Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E5375B5DBC4 for ; Tue, 27 Sep 2011 01:21:34 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 48094-06 for ; Tue, 27 Sep 2011 04:21:28 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 37E8CB5DBCE for ; Tue, 27 Sep 2011 01:21:28 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p8R4LMHS014104; Tue, 27 Sep 2011 00:21:22 -0400 (EDT) To: Royce Ausburn cc: pgsql-performance Subject: Re: Ineffective autovacuum In-reply-to: <059E65EF-8C66-4DA6-835C-936D6592C94B@inomial.com> References: <059E65EF-8C66-4DA6-835C-936D6592C94B@inomial.com> Comments: In-reply-to Royce Ausburn message dated "Tue, 27 Sep 2011 13:45:33 +1000" Date: Tue, 27 Sep 2011 00:21:22 -0400 Message-ID: <14103.1317097282@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201109/381 X-Sequence-Number: 45157 Royce Ausburn writes: > I have a problem with autovacuum apparently not doing the job I need it to do. Hm, I wonder whether you're getting bit by bug #5759, which was fixed after 8.3.12. > I have a table named datasession that is frequently inserted, updated and deleted from. Typically the table will have a few thousand rows in it. Each row typically survives a few days and is updated every 5 - 10 mins. The application receives unreliable, potentially duplicate data from its source, so this table is heavily used for synchronising application threads as well. A typical access pattern is: > - tx begin > - SELECT FOR UPDATE on a single row > - Do some application processing (1 - 100 ms) > - Possibly UPDATE the row > - tx commit Transactions of that form would not interfere with autovacuum. You'd need something that wants exclusive lock, like a schema change. > I've read some recent threads and found a discussion (below) on auto vacuum that mentions auto vacuum will be cancelled when a client requests a lock that auto vacuum is using… My questions: > 1) Does it look like I'm affected by the same problem as in the below discussion? Not unless you're seeing a lot of "canceling autovacuum task" messages in the postmaster log. regards, tom lane