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

Commit344b7e1

Browse files
Add test coverage for rootdescend verification.
Commitc1afd17, which added support for rootdescend verification toamcheck, added only minimal regression test coverage. Address this bymaking sure that rootdescend verification is run on a multi-level index.In passing, simplify some of the regression tests that exercisemulti-level nbtree page deletion.Both issues spotted while rereviewing coverage of the nbtree patchseries using gcov.
1 parent86b8504 commit344b7e1

File tree

4 files changed

+10
-22
lines changed

4 files changed

+10
-22
lines changed

‎contrib/amcheck/expected/check_btree.out

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ SELECT bt_index_check('bttest_multi_idx');
109109

110110
(1 row)
111111

112-
-- more expansivetest for index with included columns
113-
SELECT bt_index_parent_check('bttest_multi_idx', true);
112+
-- more expansivetests for index with included columns
113+
SELECT bt_index_parent_check('bttest_multi_idx', true, true);
114114
bt_index_parent_check
115115
-----------------------
116116

117117
(1 row)
118118

119-
-- repeat expansivetest for index built using insertions
119+
-- repeat expansivetests for index built using insertions
120120
TRUNCATE bttest_multi;
121121
INSERT INTO bttest_multi SELECT i, i%2 FROM generate_series(1, 100000) as i;
122-
SELECT bt_index_parent_check('bttest_multi_idx', true);
122+
SELECT bt_index_parent_check('bttest_multi_idx', true, true);
123123
bt_index_parent_check
124124
-----------------------
125125

@@ -131,14 +131,11 @@ SELECT bt_index_parent_check('bttest_multi_idx', true);
131131
--
132132
INSERT INTO delete_test_table SELECT i, 1, 2, 3 FROM generate_series(1,80000) i;
133133
ALTER TABLE delete_test_table ADD PRIMARY KEY (a,b,c,d);
134-
-- Delete many entries, and vacuum. This causes page deletions.
135-
DELETE FROM delete_test_table WHERE a > 40000;
136-
VACUUM delete_test_table;
137134
-- Delete most entries, and vacuum, deleting internal pages and creating "fast
138135
-- root"
139136
DELETE FROM delete_test_table WHERE a < 79990;
140137
VACUUM delete_test_table;
141-
SELECT bt_index_parent_check('delete_test_table_pkey', true, true);
138+
SELECT bt_index_parent_check('delete_test_table_pkey', true);
142139
bt_index_parent_check
143140
-----------------------
144141

‎contrib/amcheck/sql/check_btree.sql

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,25 @@ COMMIT;
6969

7070
-- normal check outside of xact for index with included columns
7171
SELECT bt_index_check('bttest_multi_idx');
72-
-- more expansivetest for index with included columns
73-
SELECT bt_index_parent_check('bttest_multi_idx', true);
72+
-- more expansivetests for index with included columns
73+
SELECT bt_index_parent_check('bttest_multi_idx', true, true);
7474

75-
-- repeat expansivetest for index built using insertions
75+
-- repeat expansivetests for index built using insertions
7676
TRUNCATE bttest_multi;
7777
INSERT INTO bttest_multiSELECT i, i%2FROM generate_series(1,100000)as i;
78-
SELECT bt_index_parent_check('bttest_multi_idx', true);
78+
SELECT bt_index_parent_check('bttest_multi_idx', true, true);
7979

8080
--
8181
-- Test for multilevel page deletion/downlink present checks, and rootdescend
8282
-- checks
8383
--
8484
INSERT INTO delete_test_tableSELECT i,1,2,3FROM generate_series(1,80000) i;
8585
ALTERTABLE delete_test_table ADDPRIMARY KEY (a,b,c,d);
86-
-- Delete many entries, and vacuum. This causes page deletions.
87-
DELETEFROM delete_test_tableWHERE a>40000;
88-
VACUUM delete_test_table;
8986
-- Delete most entries, and vacuum, deleting internal pages and creating "fast
9087
-- root"
9188
DELETEFROM delete_test_tableWHERE a<79990;
9289
VACUUM delete_test_table;
93-
SELECT bt_index_parent_check('delete_test_table_pkey', true, true);
90+
SELECT bt_index_parent_check('delete_test_table_pkey', true);
9491

9592
--
9693
-- BUG #15597: must not assume consistent input toasting state when forming

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,9 +3225,6 @@ explain (costs off)
32253225
CREATE TABLE delete_test_table (a bigint, b bigint, c bigint, d bigint);
32263226
INSERT INTO delete_test_table SELECT i, 1, 2, 3 FROM generate_series(1,80000) i;
32273227
ALTER TABLE delete_test_table ADD PRIMARY KEY (a,b,c,d);
3228-
-- Delete many entries, and vacuum. This causes page deletions.
3229-
DELETE FROM delete_test_table WHERE a > 40000;
3230-
VACUUM delete_test_table;
32313228
-- Delete most entries, and vacuum, deleting internal pages and creating "fast
32323229
-- root"
32333230
DELETE FROM delete_test_table WHERE a < 79990;

‎src/test/regress/sql/create_index.sql

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1146,9 +1146,6 @@ explain (costs off)
11461146
CREATETABLEdelete_test_table (abigint, bbigint, cbigint, dbigint);
11471147
INSERT INTO delete_test_tableSELECT i,1,2,3FROM generate_series(1,80000) i;
11481148
ALTERTABLE delete_test_table ADDPRIMARY KEY (a,b,c,d);
1149-
-- Delete many entries, and vacuum. This causes page deletions.
1150-
DELETEFROM delete_test_tableWHERE a>40000;
1151-
VACUUM delete_test_table;
11521149
-- Delete most entries, and vacuum, deleting internal pages and creating "fast
11531150
-- root"
11541151
DELETEFROM delete_test_tableWHERE a<79990;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp