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 1rtsmj-000YhR-Jm for pgsql-committers@arkaria.postgresql.org; Mon, 08 Apr 2024 17:27:58 +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 1rtsmh-00AQF2-1c for pgsql-committers@arkaria.postgresql.org; Mon, 08 Apr 2024 17:27:55 +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 1rtsmf-00AQEu-An for pgsql-committers@lists.postgresql.org; Mon, 08 Apr 2024 17:27:54 +0000 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rtsmZ-001bit-3I for pgsql-committers@lists.postgresql.org; Mon, 08 Apr 2024 17:27:52 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id A79451380105; Mon, 8 Apr 2024 13:27:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 08 Apr 2024 13:27:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712597264; x=1712683664; bh=JtsZr6x1Nd GfcUTxkL+LvqrKlmh21ucSHoRz5nwzS70=; b=PQlhQbdb2VK9bPn7Tm0qJCe4ov anHKZRGX1DNBtKMWG3YrH3qpPeQaZl5fX4vbzfCZ7eUIncjsNAzhyuEhmdMeZLGm Iw9er1AXTjY31CetE3oQc+I/qMTZrebSlw+gCXj8oIOPjl3tOo+XEsAsYjOQ1n7g A8Z+jixI7uJawUJnIsCTTXF1BZAFw6+R+mZ/3oWkw1g/0dgXfTgqAhaILY3zD/0w 0acl4wxhLe9VvuI24ikaU3Rp7kSwwjf/wgIjAQoSeumJxvTE+yxBS0zlABSiXAXg SI0vafUaNUj4Qi8MlyNI/TT1w/JXsElTAymgPAdVR/yfPbSKCWeOg3gHmE4w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712597264; x=1712683664; bh=JtsZr6x1NdGfcUTxkL+LvqrKlmh2 1ucSHoRz5nwzS70=; b=d0Z/FBTrmRXkICikoiF6h9MjpPZen8MNjaDeoKKeQkya cqQPTfR3D8ZVM/miejAGMGjkPY2X4x/FyAdnX+xkA4+UTBxnLmndBuKgv3Xn6Y/G hfJjr3u5DaHukbmHBMKVdwFCrAJl0GW3MpvhGxQWPchxjzNiBA8R0hLhfo1M5jHD YwE+T/vJCWNKcR2tmCnyYL8sSqAXrYfcyRHiXESVmuC7xqoTM8TkgGw8v1Fb4XmZ 1YbIY7gqDb+3BTnJfMwuJfJpv+VD9IUb9hVfNSM1gxmfN+Rv9m5q009LhHU68Uiz Cu8W2eyxV1I/e6C/J8pJBm6WnVGQj7OwHzl17tCocQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegiedgudduvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpeevveeiffevjeetgfegfffgkeeuieeukedvtefhheeiudehjeelteej keeitedtffenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghnughrvghssegrnhgr rhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Apr 2024 13:27:43 -0400 (EDT) Date: Mon, 8 Apr 2024 10:27:42 -0700 From: Andres Freund To: John Naylor Cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Teach radix tree to embed values at runtime Message-ID: <20240408172742.7inv5usm5mk534tn@awork3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2024-04-08 11:57:01 +0000, John Naylor wrote: > Teach radix tree to embed values at runtime > > Previously, the decision to store values in leaves or within the child > pointer was made at compile time, with variable length values using > leaves by necessity. This commit allows introspecting the length of > variable length values at runtime for that decision. This requires > the ability to tell whether the last-level child pointer is actually > a value, so we use a pointer tag in the lowest level bit. > > Use this in TID store. This entails adding a byte to the header to > reserve space for the tag. Commit f35bd9bf3 stores up to three offsets > within the header with no bitmap, and now the header can be embedded > as above. This reduces worst-case memory usage when TIDs are sparse. This isn't quite C99 conformant, and thus breaks on the buildfarm animal set up to test that: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=mylodon&dt=2024-04-08%2012%3A07%3A01 You can't have unnamed structs in C99, that's a C11 feature. I wish we'd move to C11, but ... Greetings, Andres