mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
### 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 [Perf] Optimize $merge "merge" option ---- #### AI description (iteration 1) #### PR Classification Performance optimization: Single document in collection and each entry is average of 10 runs.  #### PR Summary This pull request optimizes the `$merge` "merge" option by improving the handling of BSON elements. - `bson_aggregation_output_pipeline.c`: Replaces the tree-based approach with a hash table to manage BSON elements, ensuring order and improving performance. - Adds new functions and data structures for creating and managing an ordered hash set of BSON elements.