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

Commit4c51a2d

Browse files
committed
Improve test coverage of ginvacuum.c.
Add a test case that exercises vacuum's deletion of empty GINposting pages. Since this is a temp table, it should now workreliably to delete a bunch of rows and immediately VACUUM.Before the preceding commit, this would not have had the desiredeffect, at least not in parallel regression tests.Discussion:https://postgr.es/m/3490536.1598629609@sss.pgh.pa.us
1 parenta7212be commit4c51a2d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,27 @@ select count(*) from t_gin_test_tbl where j @> '{}'::int[];
264264
20006
265265
(1 row)
266266

267+
-- test vacuuming of posting trees
268+
delete from t_gin_test_tbl where j @> array[2];
269+
vacuum t_gin_test_tbl;
270+
select count(*) from t_gin_test_tbl where j @> array[50];
271+
count
272+
-------
273+
0
274+
(1 row)
275+
276+
select count(*) from t_gin_test_tbl where j @> array[2];
277+
count
278+
-------
279+
0
280+
(1 row)
281+
282+
select count(*) from t_gin_test_tbl where j @> '{}'::int[];
283+
count
284+
-------
285+
6
286+
(1 row)
287+
267288
reset enable_seqscan;
268289
reset enable_bitmapscan;
269290
drop table t_gin_test_tbl;

‎src/test/regress/sql/gin.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ explain (costs off)
159159
selectcount(*)from t_gin_test_tblwhere j @>'{}'::int[];
160160
selectcount(*)from t_gin_test_tblwhere j @>'{}'::int[];
161161

162+
-- test vacuuming of posting trees
163+
deletefrom t_gin_test_tblwhere j @> array[2];
164+
vacuum t_gin_test_tbl;
165+
166+
selectcount(*)from t_gin_test_tblwhere j @> array[50];
167+
selectcount(*)from t_gin_test_tblwhere j @> array[2];
168+
selectcount(*)from t_gin_test_tblwhere j @>'{}'::int[];
169+
162170
reset enable_seqscan;
163171
reset enable_bitmapscan;
164172

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp