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 1rOhee-006PYJ-NV for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jan 2024 17:18:45 +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 1rOhec-008lPk-06 for pgsql-hackers@arkaria.postgresql.org; Sat, 13 Jan 2024 17:18:42 +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 1rOheb-008lPb-Mx for pgsql-hackers@lists.postgresql.org; Sat, 13 Jan 2024 17:18:41 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rOheX-001aXr-SV for pgsql-hackers@lists.postgresql.org; Sat, 13 Jan 2024 17:18:40 +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 40DHIWph966600; Sat, 13 Jan 2024 12:18:32 -0500 From: Tom Lane To: Xiaoran Wang cc: pgsql-hackers@lists.postgresql.org, Andres Freund Subject: Re: Recovering from detoast-related catcache invalidations In-reply-to: References: <329632.1705011663@sss.pgh.pa.us> <754826.1705090452@sss.pgh.pa.us> <793469.1705092433@sss.pgh.pa.us> Comments: In-reply-to Xiaoran Wang message dated "Sat, 13 Jan 2024 17:02:15 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <966598.1705166312.1@sss.pgh.pa.us> Date: Sat, 13 Jan 2024 12:18:32 -0500 Message-ID: <966599.1705166312@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Xiaoran Wang writes: > Hmm, how about first checking if any invalidated shared messages have been > accepted, then rechecking the tuple's visibility? > If there is no invalidated shared message accepted during > 'toast_flatten_tuple', > there is no need to do then visibility check, then it can save several > CPU cycles. Meh, I'd just as soon not add the additional dependency/risk of bugs. This is an expensive and seldom-taken code path, so I don't think shaving a few cycles is really important. regards, tom lane