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

Commit20c6905

Browse files
Add posting list tuple amcheck test case.
Add a test case to contrib/amcheck that creates coverage of code pathsthat are used to verify posting list tuples (tuples created whendeduplication merges together existing tuples to avoid a leaf pagesplit).
1 parent4704676 commit20c6905

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

‎contrib/amcheck/expected/check_btree.out

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ALTER TABLE delete_test_table SET (autovacuum_enabled = false);
1010
INSERT INTO bttest_a SELECT * FROM generate_series(1, 100000);
1111
INSERT INTO bttest_b SELECT * FROM generate_series(100000, 1, -1);
1212
INSERT INTO bttest_multi SELECT i, i%2 FROM generate_series(1, 100000) as i;
13-
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id);
13+
CREATE INDEX bttest_a_idx ON bttest_a USING btree (id) WITH (deduplicate_items = ON);
1414
CREATE INDEX bttest_b_idx ON bttest_b USING btree (id);
1515
CREATE UNIQUE INDEX bttest_multi_idx ON bttest_multi
1616
USING btree (id) INCLUDE (data);
@@ -102,6 +102,15 @@ WHERE relation = ANY(ARRAY['bttest_a', 'bttest_a_idx', 'bttest_b', 'bttest_b_idx
102102
(0 rows)
103103

104104
COMMIT;
105+
-- Deduplication
106+
TRUNCATE bttest_a;
107+
INSERT INTO bttest_a SELECT 42 FROM generate_series(1, 2000);
108+
SELECT bt_index_check('bttest_a_idx', true);
109+
bt_index_check
110+
----------------
111+
112+
(1 row)
113+
105114
-- normal check outside of xact for index with included columns
106115
SELECT bt_index_check('bttest_multi_idx');
107116
bt_index_check

‎contrib/amcheck/sql/check_btree.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ INSERT INTO bttest_a SELECT * FROM generate_series(1, 100000);
1313
INSERT INTO bttest_bSELECT*FROM generate_series(100000,1,-1);
1414
INSERT INTO bttest_multiSELECT i, i%2FROM generate_series(1,100000)as i;
1515

16-
CREATEINDEXbttest_a_idxON bttest_a USING btree (id);
16+
CREATEINDEXbttest_a_idxON bttest_a USING btree (id) WITH (deduplicate_items=ON);
1717
CREATEINDEXbttest_b_idxON bttest_b USING btree (id);
1818
CREATEUNIQUE INDEXbttest_multi_idxON bttest_multi
1919
USING btree (id) INCLUDE (data);
@@ -67,6 +67,11 @@ WHERE relation = ANY(ARRAY['bttest_a', 'bttest_a_idx', 'bttest_b', 'bttest_b_idx
6767
AND pid= pg_backend_pid();
6868
COMMIT;
6969

70+
-- Deduplication
71+
TRUNCATE bttest_a;
72+
INSERT INTO bttest_aSELECT42FROM generate_series(1,2000);
73+
SELECT bt_index_check('bttest_a_idx', true);
74+
7075
-- normal check outside of xact for index with included columns
7176
SELECT bt_index_check('bttest_multi_idx');
7277
-- more expansive tests for index with included columns

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp