From 099c7b078d6577be4d5095cc6825d97e1f1968ee Mon Sep 17 00:00:00 2001
From: Pavel Borisov
Date: Mon, 12 Oct 2020 15:40:24 +0400
Subject: [PATCH 2/2] Extra tests for GiST index build
---
src/test/regress/expected/gist.out | 11 ++++++++---
src/test/regress/sql/gist.sql | 13 ++++++++++---
2 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/src/test/regress/expected/gist.out b/src/test/regress/expected/gist.out
index 90edb4061d..881623c755 100644
--- a/src/test/regress/expected/gist.out
+++ b/src/test/regress/expected/gist.out
@@ -3,7 +3,7 @@
--
-- There are other tests to test different GiST opclasses. This is for
-- testing GiST code itself. Vacuuming in particular.
-create table gist_point_tbl(id int4, p point);
+create table gist_point_tbl(id int4, p point, t text);
create index gist_pointidx on gist_point_tbl using gist(p);
-- Verify the fillfactor and buffering options
create index gist_pointidx2 on gist_point_tbl using gist(p) with (buffering = on, fillfactor=50);
@@ -21,10 +21,15 @@ create index gist_pointidx5 on gist_point_tbl using gist(p) with (fillfactor=101
ERROR: value 101 out of bounds for option "fillfactor"
DETAIL: Valid values are between "10" and "100".
-- Insert enough data to create a tree that's a couple of levels deep.
-insert into gist_point_tbl (id, p)
-select g, point(g*10, g*10) from generate_series(1, 10000) g;
+insert into gist_point_tbl (id, p, t)
+select g, point(g*10, g*10), repeat('x', 250) from generate_series(1, 20000) g;
+insert into gist_point_tbl (id, p, t)
+select g, point(g*10, g*10), repeat('x', 250) from generate_series(1, 20000) g;
insert into gist_point_tbl (id, p)
select g+100000, point(g*10+1, g*10+1) from generate_series(1, 10000) g;
+-- Test buffering index build with data
+create index gist_pointidx6 on gist_point_tbl using gist(p) include(t) with (buffering = on, fillfactor=50);
+drop index gist_pointidx6;
-- To test vacuum, delete some entries from all over the index.
delete from gist_point_tbl where id % 2 = 1;
-- And also delete some concentration of values.
diff --git a/src/test/regress/sql/gist.sql b/src/test/regress/sql/gist.sql
index b9d398ea94..4e39cf176d 100644
--- a/src/test/regress/sql/gist.sql
+++ b/src/test/regress/sql/gist.sql
@@ -4,7 +4,7 @@
-- There are other tests to test different GiST opclasses. This is for
-- testing GiST code itself. Vacuuming in particular.
-create table gist_point_tbl(id int4, p point);
+create table gist_point_tbl(id int4, p point, t text);
create index gist_pointidx on gist_point_tbl using gist(p);
-- Verify the fillfactor and buffering options
@@ -19,12 +19,19 @@ create index gist_pointidx5 on gist_point_tbl using gist(p) with (fillfactor=9);
create index gist_pointidx5 on gist_point_tbl using gist(p) with (fillfactor=101);
-- Insert enough data to create a tree that's a couple of levels deep.
-insert into gist_point_tbl (id, p)
-select g, point(g*10, g*10) from generate_series(1, 10000) g;
+insert into gist_point_tbl (id, p, t)
+select g, point(g*10, g*10), repeat('x', 250) from generate_series(1, 20000) g;
+
+insert into gist_point_tbl (id, p, t)
+select g, point(g*10, g*10), repeat('x', 250) from generate_series(1, 20000) g;
insert into gist_point_tbl (id, p)
select g+100000, point(g*10+1, g*10+1) from generate_series(1, 10000) g;
+-- Test buffering index build with data
+create index gist_pointidx6 on gist_point_tbl using gist(p) include(t) with (buffering = on, fillfactor=50);
+drop index gist_pointidx6;
+
-- To test vacuum, delete some entries from all over the index.
delete from gist_point_tbl where id % 2 = 1;
--
2.28.0