Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6af174

Browse files
author
Arseny Kositsyn
committed
[PGPRO-12159] Code review.
Refactoring has been performed. The code isdivided into more logical blocks using addedfunctions and macros with clear names.Tags: rum
1 parent9665cf6 commitf6af174

File tree

4 files changed

+745
-992
lines changed

4 files changed

+745
-992
lines changed

‎Makefile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ include $(top_builddir)/src/Makefile.global
4545
include$(top_srcdir)/contrib/contrib-global.mk
4646
endif
4747

48-
$(EXTENSION)--$(EXTVERSION).sql: rum_init.sql
49-
cat$^>$@
50-
5148
# rum_debug_funcs tests only for enterprise
5249
ifneq ($(PGPRO_EDITION), enterprise)
5350
REGRESS := $(filter-out rum_debug_funcs, $(REGRESS))
5451
endif
5552

53+
$(EXTENSION)--$(EXTVERSION).sql: rum_init.sql
54+
cat$^>$@
55+
5656
#
5757
# On versions 12 and 13 isolation tests cannot be run using pgxs.
5858
# Override installcheck target to avoid the error. This is just a

‎expected/rum_debug_funcs.out‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8638,12 +8638,12 @@ SELECT * FROM rum_page_opaque_info('test_with_weight_idx', 21);
86388638
(1 row)
86398639

86408640
SELECT * FROM rum_internal_data_page_items('test_with_weight_idx', 21);
8641-
is_high_key | block_number | tuple_id | add_info_is_null |add_info
8642-
-------------+--------------+----------+------------------+-----------------------------------------------------
8641+
is_high_key | block_number | tuple_id | add_info_is_null | add_info
8642+
-------------+--------------+----------+------------------+------------------------------------------------
86438643
t | | (0,0) | t |
8644-
f | 23 | (39,43) | f |high key positions in posting tree is not supported
8645-
f | 22 | (74,9) | f |high key positions in posting tree is not supported
8646-
f | 24 | (98,9) | f |high key positions in posting tree is not supported
8644+
f | 23 | (39,43) | f |varlena types in posting tree is not supported
8645+
f | 22 | (74,9) | f |varlena types in posting tree is not supported
8646+
f | 24 | (98,9) | f |varlena types in posting tree is not supported
86478647
f | 25 | (0,0) | t |
86488648
(5 rows)
86498649

@@ -8654,9 +8654,9 @@ SELECT * FROM rum_page_opaque_info('test_with_weight_idx', 22);
86548654
(1 row)
86558655

86568656
SELECT * FROM rum_leaf_data_page_items('test_with_weight_idx', 22);
8657-
is_high_key | tuple_id | add_info_is_null |add_info
8658-
-------------+----------+------------------+-----------------------------------------------------
8659-
t | (74,9) | f |high key positions in posting tree is not supported
8657+
is_high_key | tuple_id | add_info_is_null | add_info
8658+
-------------+----------+------------------+------------------------------------------------
8659+
t | (74,9) | f |varlena types in posting tree is not supported
86608660
f | (40,1) | f | 1A,9
86618661
f | (40,2) | f | 1A,9
86628662
f | (40,3) | f | 1A,9

‎rum_init.sql‎

Lines changed: 91 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,51 +1752,101 @@ CREATE FUNCTION rum_page_opaque_info(
17521752
AS'MODULE_PATHNAME','rum_page_opaque_info'
17531753
LANGUAGE C STRICT PARALLEL SAFE;
17541754

1755-
CREATEFUNCTIONrum_leaf_data_page_items(
1756-
IN rel_nametext,
1757-
IN blk_num int4,
1758-
OUT is_high_key bool,
1759-
OUT tuple_id tid,
1760-
OUT add_info_is_null bool,
1761-
OUT add_infovarchar)
1755+
CREATEOR REPLACE FUNCTION
1756+
rum_page_items_info(rel_nametext, blk_num int4, page_type int4)
17621757
RETURNS SETOF record
1763-
AS'MODULE_PATHNAME','rum_leaf_data_page_items'
1764-
LANGUAGE C STRICT PARALLEL SAFE;
1758+
AS'MODULE_PATHNAME','rum_page_items_info'
1759+
LANGUAGE C STRICT;
1760+
1761+
CREATEFUNCTIONrum_leaf_data_page_items(
1762+
rel_nametext,
1763+
blk_num int4
1764+
)
1765+
RETURNS TABLE(
1766+
is_high_key bool,
1767+
tuple_id tid,
1768+
add_info_is_null bool,
1769+
add_infovarchar
1770+
)
1771+
AS $$
1772+
SELECT*
1773+
FROM rum_page_items_info(rel_name, blk_num,0)
1774+
AS rum_page_items_info(
1775+
is_high_key bool,
1776+
tuple_id tid,
1777+
add_info_is_null bool,
1778+
add_infovarchar
1779+
);
1780+
$$ LANGUAGE sql;
17651781

17661782
CREATEFUNCTIONrum_internal_data_page_items(
1767-
IN rel_nametext,
1768-
IN blk_num int4,
1769-
OUT is_high_key bool,
1770-
OUT block_number int4,
1771-
OUT tuple_id tid,
1772-
OUT add_info_is_null bool,
1773-
OUT add_infovarchar)
1774-
RETURNS SETOF record
1775-
AS'MODULE_PATHNAME','rum_internal_data_page_items'
1776-
LANGUAGE C STRICT PARALLEL SAFE;
1783+
rel_nametext,
1784+
blk_num int4
1785+
)
1786+
RETURNS TABLE(
1787+
is_high_key bool,
1788+
block_number int4,
1789+
tuple_id tid,
1790+
add_info_is_null bool,
1791+
add_infovarchar
1792+
)
1793+
AS $$
1794+
SELECT*
1795+
FROM rum_page_items_info(rel_name, blk_num,1)
1796+
AS rum_page_items_info(
1797+
is_high_key bool,
1798+
block_number int4,
1799+
tuple_id tid,
1800+
add_info_is_null bool,
1801+
add_infovarchar
1802+
);
1803+
$$ LANGUAGE sql;
17771804

17781805
CREATEFUNCTIONrum_leaf_entry_page_items(
1779-
IN rel_nametext,
1780-
IN blk_num int4,
1781-
OUT keyvarchar,
1782-
OUT attrnum int4,
1783-
OUT categoryvarchar,
1784-
OUT tuple_id tid,
1785-
OUT add_info_is_null bool,
1786-
OUT add_infovarchar,
1787-
OUT is_postring_tree bool,
1788-
OUT postring_tree_root int4)
1789-
RETURNS SETOF record
1790-
AS'MODULE_PATHNAME','rum_leaf_entry_page_items'
1791-
LANGUAGE C STRICT PARALLEL SAFE;
1806+
rel_nametext,
1807+
blk_num int4
1808+
)
1809+
RETURNS TABLE(
1810+
keyvarchar,
1811+
attrnum int4,
1812+
categoryvarchar,
1813+
tuple_id tid,
1814+
add_info_is_null bool,
1815+
add_infovarchar,
1816+
is_postring_tree bool,
1817+
postring_tree_root int4
1818+
)
1819+
AS $$
1820+
SELECT*
1821+
FROM rum_page_items_info(rel_name, blk_num,2)
1822+
AS rum_page_items_info(
1823+
keyvarchar,
1824+
attrnum int4,
1825+
categoryvarchar,
1826+
tuple_id tid,
1827+
add_info_is_null bool,
1828+
add_infovarchar,
1829+
is_postring_tree bool,
1830+
postring_tree_root int4
1831+
);
1832+
$$ LANGUAGE sql;
17921833

17931834
CREATEFUNCTIONrum_internal_entry_page_items(
1794-
IN rel_nametext,
1795-
IN blk_num int4,
1796-
OUT keyvarchar,
1797-
OUT attrnum int4,
1798-
OUT categoryvarchar,
1799-
OUT down_link int4)
1800-
RETURNS SETOF record
1801-
AS'MODULE_PATHNAME','rum_internal_entry_page_items'
1802-
LANGUAGE C STRICT PARALLEL SAFE;
1835+
rel_nametext,
1836+
blk_num int4
1837+
)
1838+
RETURNS TABLE(
1839+
keyvarchar,
1840+
attrnum int4,
1841+
categoryvarchar,
1842+
down_link int4)
1843+
AS $$
1844+
SELECT*
1845+
FROM rum_page_items_info(rel_name, blk_num,3)
1846+
AS rum_page_items_info(
1847+
keyvarchar,
1848+
attrnum int4,
1849+
categoryvarchar,
1850+
down_link int4
1851+
);
1852+
$$ LANGUAGE sql;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp