Files
documentdb/pg_documentdb/include
Vinod Sridharan 73db6c6000 Merged PR 1639906: [Order by POC] Push down order by to the index under a flag
### Does this PR have any customer impact?
Yes

### 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?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description

Implement ordered scan in the index layer - leverage GIN extensibility points to do so.
Allow order by pushdown to the index.

Still doesn't work:
- Truncation
- Array terms and order by

Still needs improvement:
- Performance when there's disjoint index trees to be scanned.

----
#### AI description  (iteration 1)
#### PR Classification
New feature

#### PR Summary
This pull request introduces the ability to push down the `ORDER BY` clause to the index under a feature flag.
- `pgmongo_rum/src/rumget.c`: Added functions `MoveScanForward`, `scanGetItemOrdered`, and `startOrderedScanEntries` to handle ordered scans.
- `pgmongo/src/test/regress/expected/internal_bson_composite_order_by_index_tests.out`: Added tests to validate the new ordered index scan feature, including correctness and edge cases.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-04-17 18:40:16 +08:00
..