Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKepN-00A1b5-7d for pgsql-performance@arkaria.postgresql.org; Mon, 09 Dec 2024 14:33:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tKepK-009Pro-LY for pgsql-performance@arkaria.postgresql.org; Mon, 09 Dec 2024 14:33:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKepK-009Prg-AY for pgsql-performance@lists.postgresql.org; Mon, 09 Dec 2024 14:33:35 +0000 Received: from smtp111.iad3a.emailsrvr.com ([173.203.187.111]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tKepI-001twx-Ns for pgsql-performance@lists.postgresql.org; Mon, 09 Dec 2024 14:33:34 +0000 X-Auth-ID: xof@thebuild.com Received: by smtp30.relay.iad3a.emailsrvr.com (Authenticated sender: xof-AT-thebuild.com) with ESMTPSA id 78CA642C5; Mon, 9 Dec 2024 09:33:30 -0500 (EST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: PostgreSQL and a Catch-22 Issue related to dead rows From: Christophe Pettus In-Reply-To: Date: Mon, 9 Dec 2024 06:32:59 -0800 Cc: "pgsql-performance@lists.postgresql.org" Content-Transfer-Encoding: quoted-printable Message-Id: <5EE4CC0C-E624-4E82-A2E8-B2EBA44D3521@thebuild.com> References: To: Lars Aksel Opsahl X-Mailer: Apple Mail (2.3776.700.51) X-Classification-ID: 01c4ba0f-4133-4d75-81b5-316c0738b0fa-1-1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Dec 9, 2024, at 03:02, Lars Aksel Opsahl = wrote: > If there were a way to remove dead rows without requiring a commit = from totally unrelated jobs, it would be much easier. Without seeing into the future, PostgreSQL doesn't know if a particular = open transaction is "totally unrelated" to any other open transaction. = Any open transaction can potentially see rows that have been deleted or = updated since it began, and without knowing what operations are coming, = it doesn't know if it is safe to remove them. (Strictly speaking, the rows you are describing are not "dead," in that = they are still visible to some transaction.)