diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-09-01 18:40:37 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-09-01 18:40:43 -0400 |
commit | 4c51a2d1e4b750bc11b8de9a85b079a14f798741 (patch) | |
tree | d802c9e30d1b6aacaff595720bf10bfba0980989 /src | |
parent | a7212be8b9e0885ee769e8c55f99ef742cda487b (diff) | |
download | postgresql-4c51a2d1e4b750bc11b8de9a85b079a14f798741.tar.gz postgresql-4c51a2d1e4b750bc11b8de9a85b079a14f798741.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/expected/gin.out | 21 | ||||
-rw-r--r-- | src/test/regress/sql/gin.sql | 8 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/test/regress/expected/gin.out b/src/test/regress/expected/gin.out index b335466fc4b..6402e89c7ff 100644 --- a/src/test/regress/expected/gin.out +++ b/src/test/regress/expected/gin.out @@ -264,6 +264,27 @@ select count(*) from t_gin_test_tbl where j @> '{}'::int[]; 20006 (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_bitmapscan; drop table t_gin_test_tbl; diff --git a/src/test/regress/sql/gin.sql b/src/test/regress/sql/gin.sql index efb8ef3e964..5194afcc1f5 100644 --- a/src/test/regress/sql/gin.sql +++ b/src/test/regress/sql/gin.sql @@ -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[]; +-- 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_bitmapscan; |