Re: Index AM API cleanup

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Paul A Jungwirth <pj@illuminatedcomputing.com>, Mark Dilger <mark.dilger@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Andrew Dunstan <andrew@dunslane.net>, Alex Wang <alex.wang@enterprisedb.com>
Date: 2025-02-25T12:21:00Z
Lists: pgsql-hackers

Attachments

Here is a rebased version of the main patch set.

As before, the patches marked [TEST] are not intended for committing, 
they are just to support testing this patch series.

Also, after some offline discussions, we are disregarding patch 0004 
"WIP: Add cluster support to the index AM API" for now.  It needs a 
different approach.

The remaining patches

0008 Generalize hash and ordering support in amapi
0010 WIP: Some stuff in AlterOpFamilyAdd
0011 FIXME: Fix direct cast from strategy to cmptype
0012 Use CompareType more and StrategyNumber less
0013 Generalize predicate tests beyond btree strategies
0014 Allow non-btree indexes to participate in mergejoin
0015 Replace various references to btree strategies

are in play at various stages of readiness.

I think 0008 is pretty much ready with some comment and documentation 
tweaking.

0013 and 0014 are also pretty straightforward.

The others (0010, 0011, 0012, 0015) still need a bit of work in some 
details, but overall the concepts are pretty solid now.

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Relax ordering-related hardcoded btree requirements in planning

  2. Support non-btree indexes in get_actual_variable_range()

  3. Convert PathKey to use CompareType

  4. Generalize index support in network support function

  5. Update a code comment

  6. Allow non-btree unique indexes for matviews

  7. Allow non-btree unique indexes for partition keys

  8. Add some opfamily support functions to lsyscache.c

  9. Simplify and generalize PrepareSortSupportFromIndexRel()

  10. Generalize hash and ordering support in amapi

  11. Drop opcintype from index AM strategy translation API

  12. Allow non-btree speculative insertion indexes

  13. Support non-btree indexes for foreign keys

  14. Integrate GistTranslateCompareType() into IndexAmTranslateCompareType()

  15. Convert strategies to and from compare types

  16. Move CompareType to separate header file

  17. Add get_opfamily_name() function

  18. Rename GistTranslateStratnum() to GistTranslateCompareType()

  19. Change gist stratnum function to use CompareType

  20. Rename RowCompareType to CompareType

  21. Improve slightly misleading internal error message

  22. Track scan reversals in MergeJoin

  23. Track sort direction in SortGroupClause

  24. Add stratnum GiST support function

  25. Add amgettreeheight index AM API routine