Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGjvb-0000Vq-IN for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Sep 2020 14:21:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kGjva-0004aO-GS for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Sep 2020 14:21:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGjva-0004aH-AM for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2020 14:21:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kGjvX-0003sN-T5 for pgsql-bugs@lists.postgresql.org; Fri, 11 Sep 2020 14:21:25 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 08BELLWP371036; Fri, 11 Sep 2020 10:21:22 -0400 From: Tom Lane To: Michael Paquier cc: gsaviane@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #16614: Stale temporary objects makes vacuum ineffective when 1 million transactions remain In-reply-to: <20200911063036.GH2743@paquier.xyz> References: <16614-23e5c4c4567d1576@postgresql.org> <182231.1599749034@sss.pgh.pa.us> <20200911063036.GH2743@paquier.xyz> Comments: In-reply-to Michael Paquier message dated "Fri, 11 Sep 2020 15:30:36 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <371034.1599834081.1@sss.pgh.pa.us> Date: Fri, 11 Sep 2020 10:21:21 -0400 Message-ID: <371035.1599834081@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Michael Paquier writes: > Yeah. 11 and newer versions have been made even more aggressive with > the cleanup of orphaned tables in autovacuum, particularly the case > where a backend reuses the ID of a past session that crashed, leaving > behind some temporary tables. Perhaps that was the case here? Off-list, the OP indicated that the problem is actually of the other category, ie the problematic tables belong to extremely long-lived sessions that are managed by a connection pooler. I don't quite understand why the pooler isn't issuing DISCARD ALL between clients, but anyway it seems that PG is operating as designed here. regards, tom lane