Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKDS-00022L-4O for pgsql-admin@arkaria.postgresql.org; Fri, 21 Jun 2019 14:08:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heKDQ-0002sj-Uu for pgsql-admin@arkaria.postgresql.org; Fri, 21 Jun 2019 14:08:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKDQ-0002sU-HS for pgsql-admin@lists.postgresql.org; Fri, 21 Jun 2019 14:08:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heKDK-0003tU-2l for pgsql-admin@postgresql.org; Fri, 21 Jun 2019 14:08:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x5LE8Mxg029888; Fri, 21 Jun 2019 10:08:22 -0400 From: Tom Lane To: SBob cc: "Rui DeSousa" , Keith , pgsql-admin Subject: Re: Vacuum not cleaning up rows. In-reply-to: References: <15eddc60-6441-e55e-f742-bd7ea37f1873@quadratum-braccas.com> <31037.1560988222@sss.pgh.pa.us> <053c95f2-1425-23ac-0308-ca22887db156@quadratum-braccas.com> <02C3BE5C-ED36-4B36-85C3-90C774FA528B@crazybean.net> Comments: In-reply-to SBob message dated "Fri, 21 Jun 2019 09:51:09 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29886.1561126102.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 21 Jun 2019 10:08:22 -0400 Message-ID: <29887.1561126102@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk SBob writes: > I do see older backend_start values (from around 6 hours ago). However I= am confused as to how a connection to one database in a cluster can preve= nr vacuum from cleaning up row versions in a table within another database= . How is that possible since onle one database has access to this table? Because the snapshot-horizon calculations are done system-wide. We can't just lobotomize them to only consider the current DB, because that would result in wrong row-cleanup decisions for shared catalogs. There are some attempts to refine that when vacuuming a non-shared table, but that can only go so far given the limited amount of state that backends expose about this. Doing better would require expending more effort in transaction start/transaction stop/snapshot creation, which are hot spots so it hasn't seemed like it'd be a good tradeoff. regards, tom lane