Files
documentdb/pg_documentdb/include/index_am
Vinod Sridharan d75debabb4 Merged PR 1683166: [POC| Orderby] Support order by index pushdown with truncation
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
PoC
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Are you introducing any new config? If yes, do you have tests with and without them being set?

### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
Add support for orderby runtime recheck and plumb checks for truncation into the index

With this we can have the runtime recheck the orderby and the index handle the base walking of the tree.
Additionally, add support for transforms from the index key to the runtime key so that we can pass down the representation.

----
#### AI description  (iteration 1)
#### PR Classification
This pull request introduces a new feature by adding support for order-by index pushdown with truncation.

#### PR Summary
The changes overhaul the ordering and scan logic in the RUM index to correctly handle pushdown of order-by operations when truncation occurs.
- In `pgmongo_rum/src/rumget.c`, scan functions were refactored to incorporate new recheck logic and a helper (`PrepareOrderedMatchedEntry`) for processing ordered entries.
- In `oss/pg_documentdb/src/opclass/bson_gin_composite_entrypoint.c`, a new ordering transform function (`gin_bson_composite_ordering_transform`) was added and comparison logic modified to signal truncation.
- In `pgmongo_rum/src/rumscan.c` and `pgmongo_rum/src/rumvalidate.c`, the handling and validation of ordering keys were updated to support raw ordering keys with new function signatures.
- In regression test files under `/pgmongo/src/test/regress`, tests were enhanced to verify ordering with truncation.
- In `pgmongo_rum/src/rum.h`, default settings and structure fields were updated to enable order-by raw keys and track recheck status for ordering.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-05-29 12:12:31 +08:00
..