Skip to content

Commit c9a31de

Browse files
committed
[PGPRO-12159] Added pageinspect functions for rum.
This commit adds three functions for low-level exploration of the index's rum pages: 1) rum_metapage_info() -- is used to examine the information posted on the meta page (flags: {meta}). 2) rum_page_opaque_info() -- is used to examine information that is placed in the opaque area of the index page (any index page). 3) rum_leaf_data_page_items() -- is used to examine the information that is placed on the leaf pages of the posting tree (flags: {leaf, data}). To extract information, all these functions need to pass the index name and the page number. Tags: rum
1 parent b6e5430 commit c9a31de

File tree

3 files changed

+709
-1
lines changed

3 files changed

+709
-1
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ OBJS = src/rumsort.o src/rum_ts_utils.o src/rumtsquery.o \
99
src/rumbtree.o src/rumbulk.o src/rumdatapage.o \
1010
src/rumentrypage.o src/rumget.o src/ruminsert.o \
1111
src/rumscan.o src/rumutil.o src/rumvacuum.o src/rumvalidate.o \
12-
src/btree_rum.o src/rum_arr_utils.o $(WIN32RES)
12+
src/btree_rum.o src/rum_arr_utils.o src/rum_debug_funcs.o $(WIN32RES)
1313

1414
DATA_updates = rum--1.0--1.1.sql rum--1.1--1.2.sql \
1515
rum--1.2--1.3.sql

rum_init.sql

+38
Original file line numberDiff line numberDiff line change
@@ -1724,3 +1724,41 @@ RETURNS float4
17241724
AS 'MODULE_PATHNAME', 'rum_ts_score_td'
17251725
LANGUAGE C IMMUTABLE STRICT;
17261726

1727+
/*--------------------RUM debug functions-----------------------*/
1728+
1729+
CREATE FUNCTION rum_metapage_info(
1730+
IN rel_name text,
1731+
IN blk_num int8,
1732+
OUT pending_head bigint,
1733+
OUT pending_tail bigint,
1734+
OUT tail_free_size int4,
1735+
OUT n_pending_pages bigint,
1736+
OUT n_pending_tuples bigint,
1737+
OUT n_total_pages bigint,
1738+
OUT n_entry_pages bigint,
1739+
OUT n_data_pages bigint,
1740+
OUT n_entries bigint,
1741+
OUT version bigint)
1742+
AS 'MODULE_PATHNAME', 'rum_metapage_info'
1743+
LANGUAGE C STRICT PARALLEL SAFE;
1744+
1745+
CREATE FUNCTION rum_page_opaque_info(
1746+
IN rel_name text,
1747+
IN blk_num int8,
1748+
OUT leftlink bigint,
1749+
OUT rightlink bigint,
1750+
OUT maxoff int4,
1751+
OUT freespace int4,
1752+
OUT flags text[])
1753+
AS 'MODULE_PATHNAME', 'rum_page_opaque_info'
1754+
LANGUAGE C STRICT PARALLEL SAFE;
1755+
1756+
CREATE FUNCTION rum_leaf_data_page_items(
1757+
IN rel_name text,
1758+
IN blk_num int8,
1759+
OUT tuple_id tid,
1760+
OUT add_info_is_null bool,
1761+
OUT addInfo varchar)
1762+
RETURNS SETOF record
1763+
AS 'MODULE_PATHNAME', 'rum_leaf_data_page_items'
1764+
LANGUAGE C STRICT PARALLEL SAFE;

0 commit comments

Comments
 (0)