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 1ozoo7-0005vG-E2 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 00:49:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozoo5-0002di-H5 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Nov 2022 00:49:05 +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 1ozoo5-0002dZ-7x for pgsql-hackers@lists.postgresql.org; Tue, 29 Nov 2022 00:49:05 +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 1ozony-0005Ia-On for pgsql-hackers@postgresql.org; Tue, 29 Nov 2022 00:49:04 +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 2AT0msMu778526; Mon, 28 Nov 2022 19:48:54 -0500 From: Tom Lane To: Michael Paquier cc: Bruce Momjian , Robert Haas , Peter Geoghegan , Matthias van de Meent , PostgreSQL Hackers Subject: Re: Preventing indirection for IndexPageGetOpaque for known-size page special areas In-reply-to: References: <765514.1669674710@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Tue, 29 Nov 2022 09:22:22 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <778524.1669682934.1@sss.pgh.pa.us> Date: Mon, 28 Nov 2022 19:48:54 -0500 Message-ID: <778525.1669682934@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > I am wondering if it would be worth adding an AssertMacro() like in > this one, though: > https://www.postgresql.org/message-id/YkaP64JvZTMgcHtq@paquier.xyz Kind of doubt it. It'd bloat debug builds with a lot of redundant checks, and probably never catch anything. For catching problems in production, the right place to do this (and where we already do do it) is in _bt_checkpage. If any of the other AMs lack page-read-time sanity checks like _bt_checkpage, I'd be in favor of adding that. But I don't think a whole bunch of additional checks afterwards will buy much. regards, tom lane