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

Commit52b164c

Browse files
Add LP_DEAD deletion of a posting list tuple test.
Make sure that we have test coverage of the posting list tuple pathwithin _bt_xid_horizon().Per off-list complaint from Andres Freund.
1 parent6baa17f commit52b164c

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

‎src/test/regress/expected/btree_index.out

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,21 @@ BEGIN
284284
INSERT INTO dedup_unique_test_table SELECT 1;
285285
END LOOP;
286286
END$$;
287+
-- Exercise the LP_DEAD-bit-set tuple deletion code with a posting list tuple.
288+
-- The implementation prefers deleting existing items to merging any duplicate
289+
-- tuples into a posting list, so we need an explicit test to make sure we get
290+
-- coverage (note that this test also assumes BLCKSZ is 8192 or less):
291+
DROP INDEX plain_unique;
292+
DELETE FROM dedup_unique_test_table WHERE a = 1;
293+
INSERT INTO dedup_unique_test_table SELECT i FROM generate_series(0,450) i;
287294
--
288295
-- Test B-tree fast path (cache rightmost leaf page) optimization.
289296
--
290297
-- First create a tree that's at least three levels deep (i.e. has one level
291298
-- between the root and leaf levels). The text inserted is long. It won't be
292-
-- compressed because we use plain storage in the table. Only a few index
293-
-- tuples fit on each internal page, allowing us to get a tall tree with few
294-
-- pages. (A tall tree is required to trigger caching.)
299+
--TOASTcompressed because we use plain storage in the table. Only a few
300+
--indextuples fit on each internal page, allowing us to get a tall tree with
301+
--fewpages. (A tall tree is required to trigger caching.)
295302
--
296303
-- The text column must be the leading column in the index, since suffix
297304
-- truncation would otherwise truncate tuples on internal pages, leaving us

‎src/test/regress/sql/btree_index.sql

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,23 @@ BEGIN
123123
END LOOP;
124124
END$$;
125125

126+
-- Exercise the LP_DEAD-bit-set tuple deletion code with a posting list tuple.
127+
-- The implementation prefers deleting existing items to merging any duplicate
128+
-- tuples into a posting list, so we need an explicit test to make sure we get
129+
-- coverage (note that this test also assumes BLCKSZ is 8192 or less):
130+
DROPINDEX plain_unique;
131+
DELETEFROM dedup_unique_test_tableWHERE a=1;
132+
INSERT INTO dedup_unique_test_tableSELECT iFROM generate_series(0,450) i;
133+
126134
--
127135
-- Test B-tree fast path (cache rightmost leaf page) optimization.
128136
--
129137

130138
-- First create a tree that's at least three levels deep (i.e. has one level
131139
-- between the root and leaf levels). The text inserted is long. It won't be
132-
-- compressed because we use plain storage in the table. Only a few index
133-
-- tuples fit on each internal page, allowing us to get a tall tree with few
134-
-- pages. (A tall tree is required to trigger caching.)
140+
--TOASTcompressed because we use plain storage in the table. Only a few
141+
--indextuples fit on each internal page, allowing us to get a tall tree with
142+
--fewpages. (A tall tree is required to trigger caching.)
135143
--
136144
-- The text column must be the leading column in the index, since suffix
137145
-- truncation would otherwise truncate tuples on internal pages, leaving us

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp