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.96) (envelope-from ) id 1w71XU-004smy-0f for pgsql-docs@arkaria.postgresql.org; Mon, 30 Mar 2026 01:35:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w71XS-000Q3s-1w for pgsql-docs@arkaria.postgresql.org; Mon, 30 Mar 2026 01:35: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.96) (envelope-from ) id 1w71XS-000Q3h-0v for pgsql-docs@lists.postgresql.org; Mon, 30 Mar 2026 01:35:34 +0000 Received: from mail-ot1-x32c.google.com ([2607:f8b0:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w71XQ-00000001ufj-0IU0 for pgsql-docs@lists.postgresql.org; Mon, 30 Mar 2026 01:35:34 +0000 Received: by mail-ot1-x32c.google.com with SMTP id 46e09a7af769-7d1872504cbso3895728a34.0 for ; Sun, 29 Mar 2026 18:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774834530; cv=none; d=google.com; s=arc-20240605; b=jakmSTR8UqrtS4LB8bclitQ8BUc8rwo+gcbM5vJBClR5I+/Khzot5ul+Dlll3viKVE QRpiELoNu9nXor/bNTpOcG5TlDHEcni15rVaWa+yIaXcCwK6rvD1/8d+3qFgbs/i7+q5 28sk9ABmAFUOyl5LqAxmO5WcSVqFW/myHeKAybXpaQzPPqcFjtj98Uc5lUqwy0EoXWgK A5A0c53YNcptgp/3P1aF3kqB1RBAX0BpKovjhWwQ8hyrCYpexHUN9bGBWZcq5d8lSIAA armqlVmFyfUtqLrkuNwOIqbhLuNKVay98FThpD0tN4vzrM0KuFP9GIUCznQnR7lKrAD1 BJ/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DQ1mJEqXsh4s725Ym2B2sBKSkBlmTygBxKBdIEsK4FU=; fh=IcOhHDXCdlw4DyxBwOBcqB+zZXBxSViYxMBGR5hmwqo=; b=Bhy1iCgGidRrHiVfLbGTHqkg8HdzWvixjoznQzJJjZ7zJmjMZO6UXnE2gCdoSOYvhD dfh9ZfsPRFo8QLmoFSSkwBnfli50ztFA2XreUMM5s6D7DpT+JJuH/LxOCMlEWSQNNFMp I7Faq/vBSxnXmDk5lXH7fRcDggM9ga3uM3Eg6LkTnAnutWbkWw4H3AnvSusRKWTvDM26 R7UIIBRQvrkGzjzJfKup4z0oXq2Ouc5cl402ZO9CP6qsD0ODzeVvxDyxMywVU3wmuq4M ilxetxZb2zn/0jpO3rHquTTAniqN5nDrtJXfydrWwosI6eVc/kzvpXj9iJLlJA9w3fLW OO1A==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=illuminatedcomputing-com.20230601.gappssmtp.com; s=20230601; t=1774834530; x=1775439330; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DQ1mJEqXsh4s725Ym2B2sBKSkBlmTygBxKBdIEsK4FU=; b=QJu5oU70x/N7G7d4oUXHf5bkDkphWLaLVSDy7hS0KSnIXCJGT0nkk+PkHpB6X0QqWX QWAMhNi4QXZzU7qkQnviJG+lOwH0/b7WKMJpnfVaGkXLnYhiCiJCN7Y1Bb7y70n8MiRo 9OWheFKVZmdwiQA1IfXVtRHurP6fq/dmDvQ872xdMIYf6ZbHC4Cl2R9QvejTLg4gSJLr 4JQip66mp9BdmF3jGhJC+o7/7ObgOti9NVM0qtxXT1VLTXdEOfVLltkAUBS/FUAInOOU aRus10EdjP4LnuIvtjdiLAVOnk7S5XucvkjdXHlljf594s+2yeSLfLoySZ5ZXg2BScS9 nASw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774834530; x=1775439330; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DQ1mJEqXsh4s725Ym2B2sBKSkBlmTygBxKBdIEsK4FU=; b=F/m85ekUSzJHPgBs9/WTcMZhI9+Iiv8M1+npWw/6H3Teu0R293TufiQNtCK5QAl592 8XYGUaV0NHPJqYjwCEbwNkHMh6N9OI3+OV6eBCdDtsFoioClyasRaWZv0Ahwv6rHS3fD OUvT7D97bztw6GD6uuDw/Q/zTwJJHMuDgcxjnxGH5yCUj3lWqyvDa1xkarF1EzOPe4r2 8HSslaR86p7iSV4kDlEGGZlnSn1/J3WaZ8B1bxbW5RTXfwpH2zp7SO6oFy9k6/huAdpI KZbaNMJ+iPfRC/jNkrdcS4UDSBQIIup1agX+I6PyBp1jBsn7BUmMALDD7XJCop2gMxaU obbA== X-Gm-Message-State: AOJu0YzeGGXOihMcNbD6DlIHdYfaWC56SUB72BV0PB0lC3WuJy0hFnWx 1AQ1BMiyLi1iTNGFVsp8twv2TUTcbxoRI1Wt7ehYc23pBZN5l1CKoWOZe8OSlL4Z3higFNZVQle sAK21/4pw7kcP7POeWYw0SUGJPZv6Y+uNzkcL1WseGeCRlWYqSNJ+rSc= X-Gm-Gg: ATEYQzzswvVEyT7y3QUOveVsZUGwl+WtEoSkayjNrGQESIEQflfnSasxh+vhnTNdEwH QZlnWck7toDmGDmh5F2nHdqInyf5z5QM6SFxjNp3/isUIbK7JiIbZp21jMy2VdBCPdXYpe2kTSY UEsQdB8OD+Wcou6i5ZMkJK58d8qs5jqpBzbWwyM7Ogb0AC46kAu7+XDoXpGUX7mi1L6F8tN9p0s 8G4ecvsgd888sHCmLJkzUyo+mnvWOHxWeegwUmmsjkVx35OBHIUqoDUtQd7gkBQff2wb4kYRasC hnq6PxXt X-Received: by 2002:a05:6820:3395:10b0:67e:151b:1554 with SMTP id 006d021491bc7-67e151b1aa1mr4488356eaf.30.1774834530531; Sun, 29 Mar 2026 18:35:30 -0700 (PDT) MIME-Version: 1.0 References: <1855968.1774812758@sss.pgh.pa.us> In-Reply-To: <1855968.1774812758@sss.pgh.pa.us> From: Paul A Jungwirth Date: Sun, 29 Mar 2026 18:35:19 -0700 X-Gm-Features: AQROBzACnYgDhno5DWZBtg63ee8nWlmRSKnffKxhErDOL9issJ-Ew00yq8DeiIg Message-ID: Subject: Re: Correct docs about GiST leaf page structure To: Tom Lane Cc: pgsql-docs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, Mar 29, 2026 at 12:32=E2=80=AFPM Tom Lane wrote= : > > Paul A Jungwirth writes: > > Our docs for GiST indexes say the compress function is only used for > > internal pages, not leaf pages, but actually it is used everywhere. > > Here are two patches to clean things up. > > > You can see that we store compressed values with the pageinspect > > extension. For instance, multiranges are compressed to ranges. Here > > they are in leaf pages: > > Actually I think it's more complicated than that. A GiST opclass > can choose whether to compress leaf-key entries, and if it does it > can use a different representation than it does on internal pages. > You can see that in action in compress/decompress functions that > pay attention to the GISTENTRY.leafkey flag, which many do. Ah, thanks for pointing that out! > So I'm inclined to propose text more like the attached. I merged > your two patches into one (didn't seem all that useful to separate). > Also, I dropped the adjacent sentence suggesting using the STORAGE > option. AFAIK that's pretty useless here: I don't think any GiST > code pays attention to it. At least part of the reason is that it's > inadequate to describe the possibility that leaf and internal datums > are different. I think your changes are great. I agree about not needing two commits. My only hesitation is removing the line about STORAGE. In btree_gist we do declare the storage of many opclasses. But I'm not sure why. Is it necessary? Does an opclass gain some advantage from it? Does core use that information somehow? Especially if leaf keys might or might not be the same type as internal keys, I'm not sure what value declaring STORAGE can provide. (It must be for core's sake, not the opclass's, right?) Yours, --=20 Paul ~{:-) pj@illuminatedcomputing.com