1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Add "LP_DEAD item?" column to GiST pageinspect functions

This brings gist_page_items() and gist_page_items_bytea() in line with
nbtree's bt_page_items() function.

Minor follow-up to commit 756ab291, which added the GiST functions.

Author: Andrey Borodin <x4mmm@yandex-team.ru>
Discussion: https://postgr.es/m/E0794687-7315-4C29-A9C7-EC54D448596D@yandex-team.ru
This commit is contained in:
Peter Geoghegan
2021-02-14 20:11:11 -08:00
parent fa41cf8f18
commit 9e596b65f4
4 changed files with 46 additions and 42 deletions

View File

@ -31,25 +31,25 @@ SELECT * FROM gist_page_opaque_info(get_raw_page('test_gist_idx', 2));
COMMIT;
SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 0), 'test_gist_idx');
itemoffset | ctid | itemlen | keys
------------+-----------+---------+-------------------
1 | (1,65535) | 40 | (p)=((166,166))
2 | (2,65535) | 40 | (p)=((332,332))
3 | (3,65535) | 40 | (p)=((498,498))
4 | (4,65535) | 40 | (p)=((664,664))
5 | (5,65535) | 40 | (p)=((830,830))
6 | (6,65535) | 40 | (p)=((996,996))
7 | (7,65535) | 40 | (p)=((1000,1000))
itemoffset | ctid | itemlen | dead | keys
------------+-----------+---------+------+-------------------
1 | (1,65535) | 40 | f | (p)=((166,166))
2 | (2,65535) | 40 | f | (p)=((332,332))
3 | (3,65535) | 40 | f | (p)=((498,498))
4 | (4,65535) | 40 | f | (p)=((664,664))
5 | (5,65535) | 40 | f | (p)=((830,830))
6 | (6,65535) | 40 | f | (p)=((996,996))
7 | (7,65535) | 40 | f | (p)=((1000,1000))
(7 rows)
SELECT * FROM gist_page_items(get_raw_page('test_gist_idx', 1), 'test_gist_idx') LIMIT 5;
itemoffset | ctid | itemlen | keys
------------+-------+---------+-------------
1 | (0,1) | 40 | (p)=((1,1))
2 | (0,2) | 40 | (p)=((2,2))
3 | (0,3) | 40 | (p)=((3,3))
4 | (0,4) | 40 | (p)=((4,4))
5 | (0,5) | 40 | (p)=((5,5))
itemoffset | ctid | itemlen | dead | keys
------------+-------+---------+------+-------------
1 | (0,1) | 40 | f | (p)=((1,1))
2 | (0,2) | 40 | f | (p)=((2,2))
3 | (0,3) | 40 | f | (p)=((3,3))
4 | (0,4) | 40 | f | (p)=((4,4))
5 | (0,5) | 40 | f | (p)=((5,5))
(5 rows)
-- gist_page_items_bytea prints the raw key data as a bytea. The output of that is