Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 4C0A41337B8C for ; Sat, 22 Jan 2011 15:34:54 -0400 (AST) 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 64393-03 for ; Sat, 22 Jan 2011 19:34:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 5A14E13364DE for ; Sat, 22 Jan 2011 15:34:45 -0400 (AST) 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 p0MJYGdo028995; Sat, 22 Jan 2011 14:34:16 -0500 (EST) To: "John Lister" cc: pgsql-admin@postgresql.org Subject: Re: Should autovacuum do a database wide vacuum near transaction limit? In-reply-to: <97DC79D65AF14ABCB98B26C2F8BA5755@squarepi.com> References: <97DC79D65AF14ABCB98B26C2F8BA5755@squarepi.com> Comments: In-reply-to "John Lister" message dated "Sat, 22 Jan 2011 12:13:25 +0000" Date: Sat, 22 Jan 2011 14:34:16 -0500 Message-ID: <28994.1295724856@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/151 X-Sequence-Number: 36591 "John Lister" writes: >>> Was this expected behaviour with temporary tables? >> It's more expected behavior when you have long running transactions. >> I haven't seen it caused by temp tables. Was the parent process in a >> really long transaction or just open a long time without one? > The first thing I checked was for open transactions, but alas there were > none. I suspect the process had been open a long time without creating any > transactions, but don't know which process it was at this point, the > connection was owned by my colleague so need to check with him or look for > dead applications... It's possible for temp tables to remain behind after a backend crash. Not clear if that's your situation or not, but it does happen. Such tables will get cleaned out whenever the owning pg_temp_nnn schema is next used to hold temp tables --- but if it's a high-numbered schema that might not happen for a long time. Also, in 8.4 and up, autovacuum will forcibly drop orphaned temp tables once they get old enough to start creating xid-wraparound issues. regards, tom lane