From: | Peter Eisentraut <peter(at)eisentraut(dot)org> |
---|---|
To: | Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Index AM API cleanup |
Date: | 2025-03-20 11:59:29 |
Message-ID: | 5083d9ed-837d-47cd-9d40-fded88b62c10@eisentraut.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Here is a new version of the remaining main patch set. I've made a lot
of changes to reduce the size and scope.
- In version v21, you had included a bunch of expected files in the
"treeb" module, which wasn't necessary, since the test driver overwrote
those anyway. I removed those, which makes the patch much smaller.
- The patch set made various attempts to be able to use a non-btree
operator family as the referenced operator family for ordering
operators, but this was not fully developed, since you had just
hardcoded BTREE_AM_OID in most places. I have cut all of this out,
since this just blows up the patch surface but doesn't add any
functionality at this time. I believe the patch for ALTER OPERATOR
FAMILY / ADD falls into this category as well, so I have moved this to
the end of the patch series, as "WIP".
(I think this is ok because the purpose of this patch set is to allow
new index types that behave like btree in many ways, whereas what the
above feature would allow is to have a type that doesn't require a btree
operator family to communicate its semantics. These things are morally
related but technically distinct.)
- For similar reasons, I removed the changes you made in typcache.c.
With the new infrastructure we have in place, we might someday
reconsider how the type cache works and make it more independent of
hardcoded btree and hash behavior, but this is not necessary for this
patch set.
- Move the changes in rangetypes.c to a separate "WIP" patch. This
patch is incomplete, as described in the patch, and also not needed for
this patch series' goal.
- There were also a couple of other minor "excessive" generalizations
that I skipped. For example, we don't need to make the function
btcostestimate() independent of btree strategies.
- Conversely, I moved the changes in network.c to a separate patch at
the front of the patch series, and fixed them up so that they actually
work. The effect of this is easily visible in the "inet" test in the
"xtree" test module.
- I separated out the changes dealing with row compare support into a
separate patch. I think this is not fully ready. You'll see the FIXME
in src/backend/executor/nodeIndexscan.c. Also, this still had a test
for BTREE_AM_OID in it, so it didn't really work anyway. I think
leaving this out for now is not a huge loss. Index support for row
compare is a specialized feature.
- I squashed together the remaining feature patches into one patch. I
observed that you had gradually adjusted the interfaces to use
CompareType instead of strategy numbers, but then left it so that they
would accept either one (for example, PathKey). But then I went through
and removed the strategy number support for the most part, since nothing
was using it anymore. (For example, PathKey was using strategy numbers
for fake purposes anyway, so we don't need them there anymore, and it
all trickles from there in a way.) The resulting patch is much smaller
and much much simpler now, since it is mostly just a straight conversion
from strategy to compare type and not much else.
Here is the current lineup:
v22-0001-TEST-Add-loadable-modules-as-tests-of-the-amapi.patch
v22-0002-TEST-Fixup-for-test-driver.patch
This is the test setup, as before. I added a small fix to reduce the
diffs further.
v22-0003-TEST-Add-treeb-deep-copy-of-btree.patch.gz
v22-0004-TEST-treeb-fixups.patch
As before, with a compilation fix to keep up with some other changes.
v22-0005-Generalize-index-support-in-network-support-func.patch
As explained above, I think this patch stands on its own and is ready to
go. Check please.
v22-0006-Convert-from-StrategyNumber-to-CompareType.patch
This is all that remains now. I think with a bit more polishing around
the edges, some comment updates, etc., this is close to ready.
v22-0007-TEST-Rotate-treeb-strategy-numbers.patch
This still works. ;-)
v22-0008-WIP-Support-row-compare-index-scans-with-non-btr.patch
v22-0009-WIP-Generalize-index-support-in-range-type-suppo.patch
v22-0010-WIP-Allow-more-index-AMs-in-ALTER-OP-FAMILY.ADD.patch
These are postponed, as described above.
Attachment | Content-Type | Size |
---|---|---|
v22-0001-TEST-Add-loadable-modules-as-tests-of-the-amapi.patch.gz | application/x-gzip | 13.0 KB |
v22-0002-TEST-Fixup-for-test-driver.patch | text/plain | 872 bytes |
v22-0003-TEST-Add-treeb-deep-copy-of-btree.patch.gz | application/x-gzip | 237.2 KB |
v22-0004-TEST-treeb-fixups.patch | text/plain | 2.2 KB |
v22-0005-Generalize-index-support-in-network-support-func.patch | text/plain | 2.8 KB |
v22-0006-Convert-from-StrategyNumber-to-CompareType.patch | text/plain | 63.8 KB |
v22-0007-TEST-Rotate-treeb-strategy-numbers.patch | text/plain | 31.3 KB |
v22-0008-WIP-Support-row-compare-index-scans-with-non-btr.patch | text/plain | 6.9 KB |
v22-0009-WIP-Generalize-index-support-in-range-type-suppo.patch | text/plain | 1.6 KB |
v22-0010-WIP-Allow-more-index-AMs-in-ALTER-OP-FAMILY.ADD.patch | text/plain | 1.3 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Ilia Evdokimov | 2025-03-20 12:04:43 | Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment |
Previous Message | Zhijie Hou (Fujitsu) | 2025-03-20 11:53:04 | RE: Conflict detection for multiple_unique_conflicts in logical replication |