| From: | Kirill Reshke <reshkekirill(at)gmail(dot)com> |
|---|---|
| To: | Andrey Borodin <x4mmm(at)yandex-team(dot)ru> |
| Cc: | pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Roman Khapov <rkhapov(at)yandex-team(dot)ru> |
| Subject: | Re: GIN pageinspect support for entry tree and posting tree |
| Date: | 2026-01-06 16:22:01 |
| Message-ID: | CALdSSPgxaLX-=yXm-mVF47S7fYJAaEoqycXw0G3yLS5wH=019w@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Mon, 5 Jan 2026 at 13:39, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
>
>
> > On 4 Jan 2026, at 00:25, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:
> >
> > PFA v6
>
> Would it be theoretically possible to unite functions for different GIN page types?
> e.g. merge gin_entrypage_items + gin_datapage_items -> gin_tree_items? Or is it an awkward API?
>
> The patch adds whitespace errors.
> x4mmm(at)x4mmm-osx postgres % git am ~/Downloads/v6-0001-GIN-pageinspect-support-for-entry-tree-and-postin.patch
> Applying: GIN pageinspect support for entry tree and posting tree internal pages
> .git/rebase-apply/patch:236: trailing whitespace.
> .git/rebase-apply/patch:242: trailing whitespace.
> .git/rebase-apply/patch:243: trailing whitespace.
> .git/rebase-apply/patch:249: trailing whitespace.
> .git/rebase-apply/patch:284: trailing whitespace.
> warning: squelched 8 whitespace errors
> warning: 13 lines add whitespace errors.
Thanks
v7 should not suffer from this.
> Docs build fail [0]:
> [08:01:48.343] pageinspect.sgml:775: parser error : Opening and ending tag mismatch: varlistentry line 722 and variablelist
> [08:01:48.343] </variablelist>
> [08:01:48.343] ^
> [08:01:48.343] pageinspect.sgml:776: parser error : Opening and ending tag mismatch: variablelist line 637 and sect2
> [08:01:48.343] </sect2>
> [08:01:48.343] ^
> [08:01:48.343] pageinspect.sgml:1016: parser error : Opening and ending tag mismatch: sect2 line 634 and sect1
> [08:01:48.343] </sect1>
> [08:01:48.343] ^
> [08:01:48.343] pageinspect.sgml:1017: parser error : Premature end of data in tag sect1 line 3
> [08:01:48.343]
> [08:01:48.343] ^
> [08:01:48.343] pageinspect.sgml:1017: parser error : chunk is not well balanced
> [08:01:48.343]
> [08:01:48.343] ^
> [08:01:48.343] contrib.sgml:152: parser error : Entity 'pageinspect' failed to parse
> [08:01:48.343] &pageinspect;
> [08:01:48.343] ^
> [08:01:48.343] contrib.sgml:239: parser error : chunk is not well balanced
> [08:01:48.343]
> [08:01:48.343] ^
> [08:01:48.344] postgres.sgml:279: parser error : Entity 'contrib' failed to parse
> [08:01:48.344] &contrib;
In v7 this is fixed, I believe, (/varlistentry was missing)
> And 32-bit build fail [1]:
> SELECT * FROM gin_entrypage_items(get_raw_page('test1_y_idx', 1), 'test1_y_idx'::regclass);
> -[ RECORD 1 ]--------------
> itemoffset | 1
> -downlink | (2147483664,1)
> +downlink | (2147483660,1)
> tids | {"(0,1)"}
> keys | y=11
> -[ RECORD 2 ]--------------
> itemoffset | 2
> -downlink | (2147483664,1)
> +downlink | (2147483660,1)
> tids | {"(0,1)"}
> keys | y=111
>
>
> Thanks!
>
>
> Best regards, Andrey Borodin.
>
> [0] https://github.com/x4m/postgres_g/runs/59444268144
> [1] https://cirrus-ci.com/task/6255878661210112
This is because GIN on-disk format is platform-dependent, see [0]. We
align the offset where to start the Compressed GIN tuples list, that's
where the difference comes from. So, GinSetPostingOffset(itup,
newsize) on line 93 sets offset to 12 | GIN_ITUP_COMPRESSED on 32 bit
and 16 | GIN_ITUP_COMPRESSED on 64-bit. I added alternative regression
output gin_1.out to v7.
PFA v7.
[0] https://github.com/postgres/postgres/blob/master/src/backend/access/gin/ginentrypage.c#L91
--
Best regards,
Kirill Reshke
| Attachment | Content-Type | Size |
|---|---|---|
| v7-0001-GIN-pageinspect-support-for-entry-tree-and-postin.patch | application/octet-stream | 29.4 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kirill Reshke | 2026-01-06 16:28:19 | Re: GIN pageinspect support for entry tree and posting tree |
| Previous Message | Jacob Champion | 2026-01-06 16:17:04 | Re: Proposal to allow setting cursor options on Portals |