Commit 4c51a2d1 authored by Tom Lane's avatar Tom Lane

Improve test coverage of ginvacuum.c.

Add a test case that exercises vacuum's deletion of empty GIN
posting pages.  Since this is a temp table, it should now work
reliably to delete a bunch of rows and immediately VACUUM.
Before the preceding commit, this would not have had the desired
effect, at least not in parallel regression tests.

Discussion: https://postgr.es/m/3490536.1598629609@sss.pgh.pa.us
parent a7212be8
...@@ -264,6 +264,27 @@ select count(*) from t_gin_test_tbl where j @> '{}'::int[]; ...@@ -264,6 +264,27 @@ select count(*) from t_gin_test_tbl where j @> '{}'::int[];
20006 20006
(1 row) (1 row)
-- test vacuuming of posting trees
delete from t_gin_test_tbl where j @> array[2];
vacuum t_gin_test_tbl;
select count(*) from t_gin_test_tbl where j @> array[50];
count
-------
0
(1 row)
select count(*) from t_gin_test_tbl where j @> array[2];
count
-------
0
(1 row)
select count(*) from t_gin_test_tbl where j @> '{}'::int[];
count
-------
6
(1 row)
reset enable_seqscan; reset enable_seqscan;
reset enable_bitmapscan; reset enable_bitmapscan;
drop table t_gin_test_tbl; drop table t_gin_test_tbl;
...@@ -159,6 +159,14 @@ explain (costs off) ...@@ -159,6 +159,14 @@ explain (costs off)
select count(*) from t_gin_test_tbl where j @> '{}'::int[]; select count(*) from t_gin_test_tbl where j @> '{}'::int[];
select count(*) from t_gin_test_tbl where j @> '{}'::int[]; select count(*) from t_gin_test_tbl where j @> '{}'::int[];
-- test vacuuming of posting trees
delete from t_gin_test_tbl where j @> array[2];
vacuum t_gin_test_tbl;
select count(*) from t_gin_test_tbl where j @> array[50];
select count(*) from t_gin_test_tbl where j @> array[2];
select count(*) from t_gin_test_tbl where j @> '{}'::int[];
reset enable_seqscan; reset enable_seqscan;
reset enable_bitmapscan; reset enable_bitmapscan;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment