mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### 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 -->