Re: Correct docs about GiST leaf page structure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com>
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Correct docs about GiST leaf page structure
Date: 2026-03-29 19:32:38
Message-ID: 1855968.1774812758@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Paul A Jungwirth <pj(at)illuminatedcomputing(dot)com> 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.

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.

Thoughts?

regards, tom lane

Attachment Content-Type Size
v2-0001-Correct-GiST-documentation-about-compressed-value.patch text/x-diff 3.2 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2026-03-29 19:45:31 Re: cmax docs seem misleading
Previous Message Laurenz Albe 2026-03-29 18:12:17 Re: Documentation clarification request: pg_dumpall and Large Objects