Re: Index AM API cleanup

Nathan Bossart <nathandbossart@gmail.com>

From: Nathan Bossart <nathandbossart@gmail.com>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>, Kirill Reshke <reshkekirill@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, Alex Wang <alex.wang@enterprisedb.com>, Paul A Jungwirth <pj@illuminatedcomputing.com>
Date: 2025-01-15T21:15:51Z
Lists: pgsql-hackers
On Wed, Jan 15, 2025 at 03:31:12PM +0100, Peter Eisentraut wrote:
> On 04.12.24 15:49, Peter Eisentraut wrote:
>> Here is a patch set in that direction.  It renames RowCompareType to
>> CompareType and updates the surrounding commentary a bit.  And then I'm
>> changing the gist strategy mapping to use the CompareType values instead
>> of the RT* strategy numbers.  Seeing this now, I like this a lot better
>> than what we have now, because it makes it clearer in the API and the
>> code what is a real strategy number and what's a different kind of
>> thing.  (This isn't entirely the above-mentioned integration of the gist
>> support into your patch set yet, but it's a meaningful part of it.)
> 
> I have committed these, and I'll continue working my way through this patch
> set now.

cfbot's cpluspluscheck step seems to dislike the new CompareType enum
declaraction [0].  IIUC that isn't valid in C++.

[0] https://api.cirrus-ci.com/v1/task/4946960681009152/logs/headers_cpluspluscheck.log

-- 
nathan



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