Files
documentdb/internal
Santiago Fernandez Madero e7d7e4cbe4 Merged PR 1525883: Push sort by _id down to the primary key index on unsharded or when we have a...
### Does this PR have any customer impact?

### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)

### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)

### Are you introducing any new config? If yes, do you have tests with and without them being set?

### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))

### Description

Push sort by _id down to the primary key index on unsharded or when we have a shard key

----
#### AI description  (iteration 1)
#### PR Classification
Code optimization

#### PR Summary
This pull request optimizes the sorting mechanism by pushing the sort by `_id` down to the primary key index when applicable.
- Added `CanSortByObjectId` and `HasShardKeyFilterWalker` functions in `bson_aggregation_pipeline.c` to determine if sorting by `_id` can be optimized.
- Modified `HandleSort` function in `bson_aggregation_pipeline.c` to use the new optimization logic for sorting by `_id`.
- Updated function declarations in `bson_aggregation_pipeline.c` to include the new helper functions.
2024-12-16 11:37:44 +08:00
..