------- Original Message -------
On Friday, July 29th, 2022 at 19:53, Tom Lane t...@sss.pgh.pa.us wrote:

> I wonder if we can combine ideas from the two patches to get a
> better tradeoff of code coverage vs. runtime.

I was checking the Pavel patch and notice that he was using the fillfactor
parameter when creating the gist index. I changed my previous patch to include
this parameter and the code coverage of gistbuild.c and gistbuildbuffers.c was
improved to 97.7% and 92.8% respectively.

I'm attaching this new patch, could you please check if this change make sense
and also don't impact the test runtime?

> Another thing we might consider is to move the testing responsibility
> somewhere else. The reason I'm allergic to adding a lot of runtime
> here is that the core regression tests are invoked at least four times
> in a standard buildfarm run, often more. But that concern could be
> alleviated if we put the test somewhere else. Maybe contrib/btree_gist
> would be suitable?

I can't say much about it. If there's anything I can do here, please let
me know.

--
Matheus Alcantara
From 9176b605230890f08d9a2d4692dff4fd313746e4 Mon Sep 17 00:00:00 2001
From: Matheus Alcantara <mths....@pm.me>
Date: Sat, 30 Jul 2022 15:38:05 -0300
Subject: [PATCH] Improve test coverage of gist build

---
 src/test/regress/expected/gist.out | 6 ++++++
 src/test/regress/sql/gist.sql      | 9 +++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/test/regress/expected/gist.out b/src/test/regress/expected/gist.out
index a36b4c9c56..c024e5bbff 100644
--- a/src/test/regress/expected/gist.out
+++ b/src/test/regress/expected/gist.out
@@ -387,6 +387,12 @@ select p from gist_tbl order by circle(p,1) <-> point(0,0) limit 1;
 
 select p from gist_tbl order by circle(p,1) <-> point(0,0) limit 1;
 ERROR:  lossy distance functions are not supported in index-only scans
+-- Build an index using buffering caused by a index build that don't fit on cache.
+set effective_cache_size = '1MB';
+create index gist_tbl_box_index_buffering on gist_tbl using gist (p, b, c);
+reset effective_cache_size;
+-- Force an index build using buffering.
+create index gist_tbl_box_index_forcing_buffering on gist_tbl using gist (p) with (buffering=on, fillfactor=50);
 -- Clean up
 reset enable_seqscan;
 reset enable_bitmapscan;
diff --git a/src/test/regress/sql/gist.sql b/src/test/regress/sql/gist.sql
index 3360266370..6d9918cf04 100644
--- a/src/test/regress/sql/gist.sql
+++ b/src/test/regress/sql/gist.sql
@@ -169,6 +169,15 @@ explain (verbose, costs off)
 select p from gist_tbl order by circle(p,1) <-> point(0,0) limit 1;
 select p from gist_tbl order by circle(p,1) <-> point(0,0) limit 1;
 
+
+-- Build an index using buffering caused by a index build that don't fit on cache.
+set effective_cache_size = '1MB';
+create index gist_tbl_box_index_buffering on gist_tbl using gist (p, b, c);
+reset effective_cache_size;
+
+-- Force an index build using buffering.
+create index gist_tbl_box_index_forcing_buffering on gist_tbl using gist (p) with (buffering=on, fillfactor=50);
+
 -- Clean up
 reset enable_seqscan;
 reset enable_bitmapscan;
-- 
2.37.1

Reply via email to