Re: Index AM API cleanup
Peter Eisentraut <peter@eisentraut.org>
Attachments
- v19.4-0001-Change-gist-stategy-support-procedure-to-take-.patch (text/plain) patch v19-0001
- v19.4-0002-Drop-opcintype-from-index-AM-strategy-translat.patch (text/plain) patch v19-0002
On 04.02.25 14:31, Peter Eisentraut wrote: > On 03.02.25 12:08, Peter Eisentraut wrote: >> Yeah, actually this turned out to be unnecessary, because you can >> easily obtain the AM OID from the passed-in opclass ID. So I have >> fixed it that way. I have committed this whole patch set now with the >> mentioned adjustments. I'll post a rebased version of the main patch >> set soon. > > I picked off two more patches from the full patch series that can be > dealt with easily. These are > > - Support non-btree indexes for foreign keys > - Allow non-btree speculative insertion indexes > > (v19-0012 and v19-0013) > > The version of these patches that were posted in the v19 bundle replaced > the hardcoded comparison with BTREE_AM_OID by a check against > (indirectly) amcanunique. But I think that is not necessary, because at > that point we already know that we are dealing with a unique index. The > reason for the check against BTREE_AM_OID was that we didn't have a way > to get the right strategy number for other index methods. But now we > have, so we can use the strategy translation functions and we don't need > to check for btree-ness anymore. > > See attached patches. I have committed these. Here is another small issue. In the v19.2 patches, I had changed the argument of the gist strategy translation function from opclass to opfamily+opcintype. This worked well with the existing uses, but when rebasing the rest of the main patch set, it seems that the correct value of "opcintype" is not always clear or readily available. And if you think about it, we don't need that type, because the strategy mapping function is surely the same for all types supported by an opfamily. So we could simplify that by registering the gist stratnum support function in a way that you can look it up without having to worry about the type. Apparently, you can't register it with just zero in amproclefttype/amprocrighttype, that confuses some DDL commands. But I figure we could put the pseudotype "any" in there, which is moderately intuitive. And then we can drop the opcintype from all the APIs, which simplifies things. See attached patches. Thoughts?
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Relax ordering-related hardcoded btree requirements in planning
- a8025f544854 18.0 landed
-
Support non-btree indexes in get_actual_variable_range()
- 9ef1851685b7 18.0 landed
-
Convert PathKey to use CompareType
- 8123e91f5aeb 18.0 landed
-
Generalize index support in network support function
- be1cc9aaf5b7 18.0 landed
-
Update a code comment
- 190dc27998d5 18.0 landed
-
Allow non-btree unique indexes for matviews
- 9d6db8bec194 18.0 landed
-
Allow non-btree unique indexes for partition keys
- f278e1fe300a 18.0 landed
-
Add some opfamily support functions to lsyscache.c
- 7317e641268f 18.0 landed
-
Simplify and generalize PrepareSortSupportFromIndexRel()
- a359d3701991 18.0 landed
-
Generalize hash and ordering support in amapi
- ce62f2f2a0a4 18.0 landed
-
Drop opcintype from index AM strategy translation API
- 7d6d2c4bbd73 18.0 landed
-
Allow non-btree speculative insertion indexes
- b92c03342dcd 18.0 landed
-
Support non-btree indexes for foreign keys
- bfe21b760e03 18.0 landed
-
Integrate GistTranslateCompareType() into IndexAmTranslateCompareType()
- 622f678c1020 18.0 landed
-
Convert strategies to and from compare types
- c09e5a6a0165 18.0 landed
-
Move CompareType to separate header file
- 119fc30dd5bd 18.0 landed
-
Add get_opfamily_name() function
- 43493cceda2f 18.0 landed
-
Rename GistTranslateStratnum() to GistTranslateCompareType()
- a5709b5bb293 18.0 landed
-
Change gist stratnum function to use CompareType
- 630f9a43cece 18.0 landed
-
Rename RowCompareType to CompareType
- 6339f6468e82 18.0 landed
-
Improve slightly misleading internal error message
- 63e10988f870 18.0 landed
-
Track scan reversals in MergeJoin
- c594f1ad2ba7 18.0 landed
-
Track sort direction in SortGroupClause
- 0d2aa4d4937b 18.0 landed
-
Add stratnum GiST support function
- 7406ab623fee 18.0 cited
-
Add amgettreeheight index AM API routine
- 56fead44dcc7 18.0 landed