Re: Index AM API cleanup - Mailing list pgsql-hackers

From Alexandra Wang
Subject Re: Index AM API cleanup
Date
Msg-id CAK98qZ0y5OF8uTa34g=-tTHPfSqFhC-GaOb5y5o7Pn7UH8CQoA@mail.gmail.com
Whole thread Raw
List pgsql-hackers
On Thu, Aug 22, 2024 at 11:28 AM Mark Dilger
<mark.dilger@enterprisedb.com> wrote:
> > On Aug 22, 2024, at 1:36 AM, Alexandra Wang <alexandra.wang.oss@gmail.com> wrote:
> > "make installcheck" for treeb is causing issues on my end. I can
> > investigate further if it’s not a problem for others.
>
> The test module index AMs are not intended for use in any installed database, so 'make installcheck' is unnecessary.
Amere 'make check' should suffice.  However, if you want to run it, you can install the modules, edit postgresql.conf
toadd 'treeb' to shared_preload_libraries, restart the server, and run 'make installcheck'.   This is necessary for
'treeb'because it requests shared memory, and that needs to be done at startup. 

Thanks, Mark. This works, and I can run treeb now.

> The v18 patch set includes the changes your patches suggest, though I modified the approach a bit.  Specifically,
ratherthan standardizing on '1.0.0' for the module versions, as your patches do, I went with '1.0', as is standard in
othermodules in neighboring directories.  The '1.0.0' numbering was something I had been using in versions 1..16 of
thispatch, and I only partially converted to '1.0' before posting v17, so sorry about that.  The v18 patch also has
somewhitespace fixes. 
>
> To address your comments about the noise in the test failures, v18 modifies the clone_tests.pl script to do a little
morework translating the expected output to expect the module's AM name ("xash", "xtree", "treeb", or whatnot) beyond
whatthat script did in v17. 

Thanks! I see fewer failures now.

There are a few occurrences of the following error when I run "make
check" in the xtree module:

+ERROR:  bogus RowCompare index qualification

I needed to specify `amroutine->amcancrosscompare = true;` in xtree.c
to eliminate them, as below:

diff --git a/src/test/modules/xtree/access/xtree.c
b/src/test/modules/xtree/access/xtree.c
index bd472edb04..960966801d 100644
--- a/src/test/modules/xtree/access/xtree.c
+++ b/src/test/modules/xtree/access/xtree.c
@@ -33,6 +33,7 @@ xtree_indexam_handler(PG_FUNCTION_ARGS)
        amroutine->amoptsprocnum = BTOPTIONS_PROC;
        amroutine->amcanorder = true;
        amroutine->amcanhash = false;
+       amroutine->amcancrosscompare = true;
        amroutine->amcanorderbyop = false;
        amroutine->amcanbackward = true;
        amroutine->amcanunique = true;

After adding that, the regression.diffs for the xtree and treeb
modules are identical in content, with only plan diffs remaining. I
think this change should be either part of
v18-0008-Generalize-hash-and-ordering-support-in-amapi.patch or a
separate commit, similar to
v18-0009-Adjust-treeb-to-use-amcanhash-and-amcancrosscomp.patch.

Best,
Alex



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Improving the latch handling between logical replication launcher and worker processes.
Next
From: Bertrand Drouvot
Date:
Subject: Re: Add parallel columns for seq scan and index scan on pg_stat_all_tables and _indexes