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 1oT23j-0007xK-7X for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 14:17:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oT23i-0000l5-5z for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 14:17:42 +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 1oT23h-0000ko-To for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 14:17:41 +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 1oT23f-0002Xu-Qb for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 14:17: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 27UEHYhl3613566; Tue, 30 Aug 2022 10:17:34 -0400 From: Tom Lane To: Tomas Vondra cc: David Rowley , Amit Kapila , Andres Freund , Robert Haas , Yura Sokolov , PostgreSQL Developers Subject: Re: Reducing the chunk header sizes on all memory context types In-reply-to: <3605020.1661865981@sss.pgh.pa.us> References: <3137572.1661780863@sss.pgh.pa.us> <3205803.1661786437@sss.pgh.pa.us> <3478405.1661824539@sss.pgh.pa.us> <3605020.1661865981@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 30 Aug 2022 09:26:21 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3613564.1661869054.1@sss.pgh.pa.us> Date: Tue, 30 Aug 2022 10:17:34 -0400 Message-ID: <3613565.1661869054@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > So maybe we should revisit the question. It'd be worth collecting some > stats about how much extra space would be needed if we force there > to be room for a sentinel. Actually, after ingesting more caffeine, the problem with this for aset.c is that the only way to add space for a sentinel that didn't fit already is to double the space allocation. That's a little daunting, especially remembering how many places deliberately allocate power-of-2-sized arrays. You could imagine deciding that the space classifications are not power-of-2 but power-of-2-plus-one, or something like that. But that would be very invasive to the logic, and I doubt it's a good idea. regards, tom lane