mirror of
https://github.com/FerretDB/documentdb.git
synced 2026-11-25 11:49:53 -05:00
efa2b802f68b4057611a8a85be0e3ce241f3c19c
226
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
efa2b802f6 |
Merged PR 1659003: [Composite OpClass] Enable Runtime Functions and add test coverage
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature/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 Fix up runtime index recheck function support to reduce loading documents. This should reduce the number of runtime rechecks that are needed for documents and trust the index more as we will evaluate these clauses directly on the index first. Also add option to trigger jstest coverage for the new opclass - and set them to run on the MX jstests - this is still disabled right now since there are some failing tests but will be enabled separately. ---- #### AI description (iteration 1) #### PR Classification New feature: This pull request introduces runtime functions for composite index operations and enhances test coverage. #### PR Summary This pull request enables runtime functions for composite index operations, improving the flexibility and efficiency of index handling. It also adds test coverage to ensure the reliability of these new features. - `bson_gin_composite_entrypoint.c`: Refactored comparison logic to support runtime functions for index rechecks. - `bson_gin_composite_core.c`: Implemented `IsValidForIndexValue` function to handle various BSON index strategies with runtime rechecks. - `create_indexes.c`: Modified index creation logic to conditionally enable new composite index opclass based on configuration. - `bson_gin_composite_private.h`: Added `IndexRecheckArgs` structure to support runtime recheck strategies. - `testing_configs.c`: Introduced configuration options for enabling the new composite index opclass by default. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
2eb9573add |
Merged PR 1659401: [Infra] Enable diskann on pg17
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Now that diskann supports Pg17, enable consumption of diskann in pg17. ---- #### AI description (iteration 1) #### PR Classification Infrastructure update to enable the `diskann` extension on PostgreSQL 17. #### PR Summary This pull request removes previous restrictions and enables the `diskann` extension to be built and packaged for PostgreSQL 17, addressing compatibility issues. - Removed conditional checks in `oid_cache.c` and `process_utility_hook.c` that prevented `diskann` support for PG17. - Updated `pipeline_create_setup_packages.sh` and `install_setup_pg_diskann.sh` to allow packaging and installation of `pg_diskann` for PG17. - Modified `pipeline_build_extension_core.sh` to remove PG17-specific build skips for `diskann`. - Adjusted test configurations in `test_mutate_17` by removing specific test skips related to `diskann`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
ac6f028c86 |
Merged PR 1653287: [Vector Search] Enable iterative index scans for HNSW and IVF in filtering searches
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
With the release of [pgvector 0.8.0](https://github.com/pgvector/pgvector/tree/5bc7937715c67add21c8bcc0d4284162c7a0174f?tab=readme-ov-file#iterative-index-scans), which supports iterative scan for HNSW and IVF, we enable it in filtering search to support pre-filtering(currently it is post-filtering)
- Pass the new parameter "iterativeScan" through the function bson_search_param from the coordinator to the worker.
Example : { "efSearch" : 10, "iterativeScan" : "relaxed_order"}
- Enable iterative scan for hnsw/ivf index on workers:
SET LOCAL hnsw.iterative_scan = relaxed_order;
SET LOCAL ivfflat.iterative_scan = relaxed_order;
relaxed_order by default, which allows results to be slightly out of order by distance, but provides better recall.
After iterative search, re-ordering will be applied to the results.
- Set iterative scan for diskann index to relaxed_order
SET LOCAL diskann.iterative_search = relaxed_order;
- Check the availability of iterative scan in pgvector
The pgvector iterative scan is available from version 0.8.0. Currently, if the pgvector extension has not been upgraded to 0.8.0, the iterative scan will be disabled in those clusters until pgvector is upgraded to 0.8.0.
###Related GUCs
**documentdb.vectorPreFilterIterativeScanMode**: enable iterative index scans, which will automatically scan more of the index until enough results are found (relaxed_order by default)
- off, disable iterative scan
- relaxed_order, allows results to be slightly out of order by distance, but provides better recall
- strict_order, ensures results are in the exact order by distance
####GUCs from pgvector
**hnsw.max_scan_tuples**: Specify the max number of tuples to visit (20,000 by default)
**hnsw.scan_mem_multiplier**: Specify the max amount of memory to use, as a multiple of work_mem (1 by default)
**ivfflat.max_probes**: Specify the max number of probes(32768 by default)
###Mongo Command(no change in this PR)
```
db.testing_hnsw_vector_collection.aggregate(
[
{
"$search": {
"cosmosSearch": {
"vector": [ 3.0, 4.9, 1.0 ],
"path": "vect",
"filter": {"meta.a": [ { "b" : 3 } ]},
"k": 4,
"efSearch": 100
},
}
},
{
"$project": {
"rank": {
"$floor": [{"$multiply": [{ "$meta": "searchScore"},100000]}]
}
}
}
])
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces iterative index scans for HNSW and IVF in filtering searches, enhancing the pre-filtering capabilities of vector searches...
|
||
|
|
f602705f11 |
Merged PR 1658397: [Vector Search] Enable prefiltering by default
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Set default prefilter feature flag to true ---- #### AI description (iteration 1) #### PR Classification Enable prefiltering by default for vector search, addressing the iterative filtering search work item. #### PR Summary This pull request modifies the vector search functionality to enable prefiltering by default, optimizing query execution by utilizing index scans instead of sequential scans and sorting. This change is expected to improve performance and efficiency in vector search operations. - Changes in `/pgmongo/src/test/docdb_compat/expected/bson_aggregation_pipeline_tests_vector_hnsw_planner.out`: Replaced sequential scans and sorts with index scans for vector search queries. - Changes in `/oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_mongo.out`: Updated to use index scans, improving query performance. - Changes in `/pgmongo/src/test/docdb_compat/expected/bson_aggregation_pipeline_tests_vector_mongo.out`: Enabled index-based filtering, replacing unsupported filter errors with index checks. - Changes in `/oss/internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_ivf.out`: Reduced the number of returned rows by using index scans for vector searches. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3612471 |
||
|
|
356361bceb |
Merged PR 1628037: Add string case support for '$toDate' operator
### Does this PR have any customer impact? Yes, by this PR, $toDate could process string case ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Enhancement for exsiting operator ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) N/A ### Are you introducing any new config? If yes, do you have tests with and without them being set? N/A ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) Add string case support for '$toDate' operator ### Description Before this PR, `$toDate` could not parse a string to datetime. With this PR, we leverage the ability of `$dateFromString` to finish the support of string case for `$toDate` operator ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for string case conversion in the `$toDate` operator. - Added `StringToDateWithDefaultFormat` function in `bson_expression_date_operators.c` to handle string to date conversion. - Updated `ProcessDollarToDate` in `bson_expression_type_operators.c` to utilize the new string conversion function. - Added tests for string case conversion in `$toDate` operator in `bson_aggregation_type_operators_tests.sql`. - Updated documentation and release notes to reflect the new feature. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
e05e91ba51 |
Merged PR 1650017: [Vector Search] Add support for PQ compression in the Diskann index
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Feature
### 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
Adding support Product Quantization (PQ) compression in vector index, which is a popular method for dramatically compressing high-dimensional vectors to use less memory, and for making nearest-neighbor search faster.
Note: currently, this PQ compression is only supported by the Diskann index.
### Related GUCs
**documentdb.enableVectorCompressionPQ**: Enables vector PQ compression (enabled by default).
### Create index spec:
- **compression**(optional):
- "half": half-precision vector, which using 16 bits floats.
- "pq": product quantization compression.
- **pqCompressedDims**(optional): indicates the dimensions after compression. If not specified, it will be automatically calculated based on the original dimensions.
- Minimum: 1
- Maximum: 8000
- **pqSampleSize**(optional):Indicates the number of samples PQ uses to generate the initial centroids. The default value is 1000.
- Minimum: 1000
- Maximum: 100000
**Note**: It is recommended to create the index after the collection has some data.. If the collection is empty, random vectors within the range [-1, 1] are used to generate the initial centroids and create the index. If the number of documents is less than pqSampleSize, the training data is padded with random data within the range [min, max] from the sampled vector data.
### Command example
```
db.runCommand(
{ "createIndexes": "testing_vector_collection", "indexes":
[{
"key": { "v": "cosmosSearch" },
"name": "hsnw_index",
"cosmosSearchOptions":
{
"kind": "vector-diskann",
"similarity": "L2",
"dimensions": 1536,
"compression": "pq",
"pqCompressedDims": 96,
"pqSampleSize": 2000
}
}]
} )
```
### Search spec:
No changes
----
#### AI description (iteration 1)
#### PR Classification
New feature: This pull request adds support for Product Quantization (PQ) compression in the Diskann index.
#### PR Summary
This pull request introduces support for PQ compression in the Diskann index, enhancing vector search capabilities. It includes error handling for unsupported compression types and validation for PQ parameters.
- Updated `/pgmongo/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_diskann.out` to include tests for PQ compression, error cases, and validation of PQ parameters such as `pqCompressedDims` and `pqSampleSize`.
- Added tests for vector search with PQ compression, including L2, cosine, and IP similarity measures.
- Implemented checks for maximum dimensions and resource limits during PQ index creation.
<!-- GitOpsUserAgent=GitOps.Apps.S...
|
||
|
|
c7e25699df |
Merged PR 1656145: version update for 103 release.
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification Version update for the release of version 103. #### PR Summary This pull request updates the version numbers across several control files and adds release notes for version 1.103 and 1.104. It also includes changes to SQL files and their corresponding SHA1 checksums. - `/oss/internal/pg_documentdb_distributed/documentdb_distributed.control`, `/oss/pg_documentdb/documentdb.control`, `/oss/pg_documentdb_core/documentdb_core.control`, and `/pgmongo/pgmongo.control`: Updated default version numbers. - `/docs/release_notes/pgmongo_1.103.md` and `/docs/release_notes/pgmongo_1.104.md`: Added release notes for versions 1.103 and 1.104. - `/pgmongo/sql/pgmongo--1.103-1--1.104-1.sql`: Added new SQL file for version transition. - `/docs/release_notes/toc.yml`: Updated table of contents to include new release notes. - `/oss/CHANGELOG.md`: Added entry for documentdb v0.104-0. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4140262 |
||
|
|
5a19661e8b |
Merged PR 1654645: [Feature Flags] Refactoring features and add some tracking
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactor ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - Add a new section for tracking feature flags - Add a feature counter to track customers whoc an benefit from the new rum_index_scan. ---- #### AI description (iteration 1) #### PR Classification Refactoring and feature enhancement with added tracking capabilities. #### PR Summary This pull request refactors feature flags and introduces new tracking capabilities for feature usage. It reorganizes the feature flag sections and adds new flags for various functionalities. - Refactored and added new feature flags in `feature_flag_configs.c`, including indexing, planner, and aggregation features. - Updated `custom_scan_continuation.c` to improve index scan handling and added feature usage reporting. - Modified `insert.c` to handle snapshot management more effectively. - Enhanced feature usage tracking in `feature_counter.c` and `feature_counter.h` by adding a new feature counter for index scans with limits. - Updated test expectations in multiple files to reflect the new feature tracking changes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
1e1a724c3f |
Merged PR 1654396: [Update procedure] Support Unsharded Remote collections
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description For the Update stored procedure for an unsharded collection on a remote node, we would typically delegate the entire request to the worker and process it there. With a SPROC, we can't delegate the whole thing to the worker. At the same time we can't make it request by request doing RPC to the worker. This change strikes a balance between the two, where we get batches of batchWriteInternalSubTransactionCount (~512) requests, and call update worker with it. Each batch is run as a single transaction on the worker, parsed, evaluated and Commited within the function. And then the outer Sproc commits the whole thing. This balances between minimizing RPCs and Committing Frequently. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces support for unsharded remote collections in the update procedure, enhancing the functionality of batch updates. Key changes include: - `update.c`: Added functions to deserialize writer errors and upserted results, serialize update batch parameters, and process batch updates non-transactionally for unsharded collections. - `commands_update_bulk.out`: Updated expected test outputs to reflect changes in batch update behavior. - `commands_update_bulk.sql`: Modified SQL tests to disable local writes and test batch update functionality with remote collections. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4093126 |
||
|
|
4ed646dfb9 |
Merged PR 1647233: [Bulk Insert][Perf] support for bulk insert via procedures
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Currently bulk insert run as a function which means that the entire execution runs as a single transaction. Each batch insert is handled as a subtransaction and rolled back to a save point if it fails. This means that document locks are held for longer, and we can hit limits w.r.t. max documents updated per transaction. In multi-node setups this also means distributed transactions are held longer causing loss of connection pools. This change introduces a stored procedure for bulk insert that periodically "Commits" the state to WAL and starts a new transaction. This more mirrors what the non-atomic bulk update is supposed to do. The old function is retained to be used within transactions. ---- #### AI description (iteration 1) #### PR Classification Performance improvement for write commands. #### PR Summary This pull request introduces a new procedure for handling write commands, enhancing performance by optimizing user-specific command execution. It includes the addition of new functions and procedures to manage MongoDB operations more efficiently. - Added new SQL functions and procedures in `/pgmongo/sql/udfs/gateway_funcs/command_funcs--1.103-0.sql` for running commands, queries, DDL, and write operations as a specific user. - Introduced new insert functions and procedures in `/oss/pg_documentdb/sql/udfs/commands_crud/insert--0.103-0.sql` to handle MongoDB insert operations. - Implemented `pgmongo_run_write_procedure_as_user` and `ExecuteWriteCommandCore` in `/pgmongo/src/infrastructure/command_funcs.c` to manage write commands with user context. - Added `CommitOuterInsertTransactions` function in `/oss/pg_documentdb/src/commands/insert.c` to handle transaction commits outside of transaction blocks. - Introduced a feature flag `EnableWriteProcedure` in `/oss/pg_documentdb/src/configs/feature_flag_configs.c` to control the enabling of write procedures. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
bec1aa3562 |
Merged PR 1638286: [engine][collation][enhancement] Extend bson_expression_get for collation support
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Add a new bson_expression_get that appends the collationString to the got value, if a valid collationString is passed to it. This will be used as a helper function to operations that rely on bson_expression_get to pass down collation such as bson_lookup_join_filter. If no collation string is passed as an arg, we simply return the got value. ---- #### AI description (iteration 1) #### PR Classification New feature to support `$graphLookup` in the engine with collation. #### PR Summary This pull request adds support for `$graphLookup` with collation in the engine. - Added new functions in `oss/pg_documentdb/sql/udfs/aggregation/bson_lookup_functions--0.103-0.sql` for `$graphLookup` operations. - Modified `oss/pg_documentdb/src/aggregation/bson_aggregation_nested_pipeline.c` to handle collation in `$graphLookup` join filters. - Updated `oss/pg_documentdb/src/operators/bson_expression.c` to remove collation handling from `bson_expression_get`. - Added `BsonDollarLookupJoinFilterWithCollationFunctionOid` in `oss/pg_documentdb/src/metadata/metadata_cache.c`. - Adjusted collation handling in `oss/pg_documentdb/src/query/bson_dollar_operators.c` for `$graphLookup`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4104899 |
||
|
|
36bb3e2920 |
Merged PR 1650400: [Bulk Update] Setup bulk update infrastructure
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Currently bulk updates run as a function which means that the entire execution runs as a single transaction. Each batch update is handled as a subtransaction and rolled back to a save point if it fails. This means that document locks are held for longer, and we can hit limits w.r.t. max documents updated per transaction. In multi-node setups this also means distributed transactions are held longer causing loss of connection pools. This change introduces a stored procedure for bulk update that periodically "Commits" the state to WAL and starts a new transaction. This more mirrors what the non-atomic bulk update is supposed to do. The old function is retained to be used within transactions. Still TODO: For unsharded collections in a multi-node setup, we need to send batches of updates to the worker. This is not wired up in this change. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces a new bulk update feature for handling non-transactional updates in the MongoDB wire-protocol. It adds new functions and procedures to support bulk updates and modifies existing update logic to accommodate this new functionality. - Added `update_bulk` procedure and related functions in `sql/udfs/commands_crud/update--0.103-0.sql` for non-transactional bulk updates. - Implemented `command_update_bulk` in `src/commands/update.c` to handle bulk updates outside of transactions. - Enhanced `ProcessBatchUpdateCore` in `src/commands/update.c` to support transactional and non-transactional updates. - Updated feature tracking in `include/utils/feature_counter.h` and `src/infrastructure/feature_counter.c` to include `FEATURE_COMMAND_UPDATE_BULK`. - Modified SQL scripts `documentdb--0.102-1--0.103-0.sql` and `pgmongo--1.102-1--1.103-0.sql` to include the new update functionality. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
71f084dca8 |
Merged PR 1644618: [Index] Improve wildcard index performance
### Does this PR have any customer impact?
Yes
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Perf
### 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
Improve index build and insert performance (especially for wildcard indexes).
The current wildcard indexes are heavily bloated - for 50 GB of data that is very array/document heavy, we could end up producing a 300 GB index in some cases.
To improve this, there's considerations of parallel index builds (introduced in PG17+), but also there's something to be said about reducing index bloat. This PR does that in two ways:
1) Given that index truncation happens at ~2500 bytes (or less), the possibility of compression for index terms is low. Therefore, even if the primary document is compressable, the index isn't. This introduces compression for index entries with a custom GUC that manages that. Especially for larger arrays and documents this yields a non-trivial saving.
2) There's a realization that with wildcard indexes and arrays, there's term duplication: An path `"a": [ 1, 2, 3 ]` generates
```
{ "a": [ 1, 2, 3 ] }
{ "a": 1 }
{ "a": 2 }
{ "a": 3 }
{ "a.0": 1 }
{ "a.1": 2 }
{ "a.2": 3 }
```
where the last 3 terms can be made redundant with the first 3. this attempts to remove those extra terms by now only generating:
```
{ "a": [ 1, 2, 3 ] }
{ "a": 1 }
{ "a": 2 }
{ "a": 3 }
```
Query plans that query a.0 will not be pushed to this index currently.
However, in the future this can be removed by querying a.0 as 'a' and running a runtime recheck.
Given that this only impacts queries that explicitly query by integer keys, and on wildcard indexes, this is deemed acceptable for the improvement in size reduction on the index.
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces support for wildcard terms in the indexing system, enhancing query capabilities and performance.
- Refactored `SerializeBsonIndexTermCore` in `gin_index_term.c` to use a new helper function `BuildSerializedIndexTerm`.
- Added `SerializeBsonIndexTermWithCompression` function in `gin_index_term.c` for handling compressed index terms.
- Implemented `QueryPathHasDigits` and `FailIfQueryPathHasDigitsForWildcard` functions in `bson_gin_entrypoint.c` to validate query paths for wildcard indexes.
- Updated various query extraction functions in `bson_gin_core.c` to use `filterElement` from `BsonExtractQueryArgs` instead of directly accessing the query.
- Enhanced `GenerateIndexExprStr` in `create_indexes.c` to include options for reduced wildcard terms and generating not-found terms.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
|
||
|
|
591a38b86d |
Merged PR 1606660: [Vector Search] Support half-precision vector indexing
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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 With the release of pgvector 0.7.0, which supports [Half-Precision Indexing](https://github.com/pgvector/pgvector?tab=readme-ov-file#half-precision-indexing), vectors can have up to 4,000 dimensions ###Related GUCs **documentdb.enableVectorCompressionHalf**: enable vector compression(enabled by default) - off, disable vector compression - on, enable vector compression ###New parameters - Create index spec: "compression": string "half": half-precision vector, which using 16 bits float - Search spec: "oversampling": double Oversampling factor: Oversampling retrieval from half index to compensate for the loss of precision. Minimum value is 1. This parameter is only permitted when a compression method is used on the vector index. For example, if oversampling=1.5 and k=10, then oversampling*k=15 vectors from a compressed index. Then, the full 32-bits vector will be used for the subsequent ordering and scoring, ###Mongo Command ``` db.runCommand( { "createIndexes": "testing_vector_collection", "indexes": [{ "key": { "v": "cosmosSearch" }, "name": "hsnw_index", "cosmosSearchOptions": { "kind": "vector-hnsw", "similarity": "L2", "dimensions": 3, "compression": "half" } }] } ) ``` ``` db.testing_hnsw_vector_collection.aggregate( [ { "$search": { "cosmosSearch": { "vector": [ 3.0, 4.9, 1.0 ], "path": "vect", "filter": {"meta.a": [ { "b" : 3 } ]}, "k": 4, "efSearch": 100, "oversampling": 2.0 }, } }, { "$project": { "rank": { "$floor": [{"$multiply": [{ "$meta": "searchScore"},100000]}] } } } ]) ``` ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for half-precision vector indexing in the vector search functionality. - `metadata_cache.c`: Added functions for half-precision vector similarity operators and functions. - `SearchTests.cs`: Added integration tests to validate half-precision vector search, including error cases and index creation scenarios. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
6207072048 |
Merged PR 1632713: Add insert test for duplicate fields and add comments on server behavior with duplicate fields for inserts
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Testing ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description - Add insert command duplicate field backend test ---- #### AI description (iteration 1) #### PR Classification New feature and documentation. #### PR Summary This pull request adds tests for inserting documents with duplicate fields and documents the server behavior regarding such inserts. - Added tests in `commands_insert.out` and `commands_insert.sql` to verify the server does not deduplicate documents with duplicate fields. - Updated `insert.c` to document that the server does not attempt to deduplicate documents during insertion. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
63ffc2501d |
Merged PR 1637344: [OSS] cleanup, don't use 'vCore' term or aka.ms short links on OSS
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Other ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) NA ### Description - cleanup Oss. - Remove referrences of `vCore` or `aka.ms` short links ---- #### AI description (iteration 1) #### PR Classification Code cleanup #### PR Summary This pull request removes references to 'vCore' and aka.ms short links from the codebase. - `scripts/validate_helio_extension_state.sh`: Added checks to ensure no 'vCore' or aka.ms links are present. - `pgmongo/src/infrastructure/logger_hooks.c`: Removed aka.ms link from error messages and added a function to update errors. - `oss/pg_documentdb/src/commands/users.c`: Removed aka.ms link from user count limit error message. - `oss/internal/pg_documentdb_distributed/src/test/regress/sql/bson_aggregation_string_operators_tests.sql`: Updated test cases to replace 'vcore' with 'v_core'. - `pgmongo/src/test/regress/expected/user_crud_commands.out`: Adjusted error messages to remove aka.ms links. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
8ea9769598 |
Merged PR 1639388: [engine][collation] Unsupported Aggregation Stages
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Aggregation stages which do not support collation yet: `bucket, group, setWindowFields, fill, geoNear, sortByCount` If collation is provided for an aggregation whose pipeline has any of these stages, the aggregation fails with `FEATURE_NOT_SUPPORTED` ---- #### AI description (iteration 1) #### PR Classification Code enhancement to handle unsupported aggregation stages with collation. #### PR Summary This pull request adds error handling for unsupported aggregation stages when collation is applied. - `bson_aggregation_pipeline.c`, `bson_aggregation_nested_pipeline.c`, `bson_aggregation_window_operators.c`: Added checks and error messages for unsupported collation in stages like `$bucket`, `$replaceWith`, `$geoNear`, `$fill`, `$group`, `$documents`, `$setWindowFields`, and `$sortByCount`. - `bson_dollar_ops_collation_tests_runtime.sql`: Added test cases for unsupported aggregation stages with collation. - `bson_dollar_ops_collation_tests_runtime.out`: Updated expected output to include error messages for unsupported collation in various stages. - `bson_query.h`: Refactored `IsBsonTypeCollationAware` function for better readability. - `bson_dollar_operators.c`: Simplified collation applicability check using `IsBsonTypeCollationAware`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4022806 |
||
|
|
48e250ab6d |
Merged PR 1641717: [oss] add arm64 to test workflow and update geo tests
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Testing
### 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?
No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
None
### Description
arm64 and amd64 handle floating-point math differently, which caused tiny differences for some geo related tests. Reduce the decimal positions to fix them.
test failure messages
**geospatial_extract_2d_geometries.out**
```
SELECT public.ST_ASTEXT(
public.ST_SUBDIVIDE(
public.ST_MAKEVALID(public.ST_SEGMENTIZE('SRID=4326;POLYGON((-180 40, -157.5 40, -157.5 55, -180 55, -180 40))'::public.geography, 500000)::public.geometry),
8 -- 8 is the default number of max vertices a divide segment can have
)::public.geography
);
st_astext
---------------------------------------------------------------------
- POLYGON((-163.1021234145348 40.4105866220272,-160.29991441874373 40.205209224804754,-180 40,-174.39787658546524 40.4105866220272,-168.75000000000003 40.54826391836536,-163.1021234145348 40.4105866220272))
+ POLYGON((-163.1021234145348 40.4105866220272,-160.29991441874373 40.205209224804754,-180 40,-174.39787658546524 40.41058662202719,-168.75000000000003 40.54826391836536,-163.1021234145348 40.4105866220272))
```
**bson_aggregation_pipeline_tests_geonear.out**
```
SELECT * FROM documentdb_api_catalog.bson_aggregation_pipeline('db', '{ "aggregate": "geonear_lookup_1", "pipeline": [ { "$geoNear": {"near": {"type": "Point", "coordinates": [0, 1]}, "distanceField": "distance", "spherical": true, "key": "a"}}, {"$lookup": {"from": "geonear_lookup_2", "localField": "x", "foreignField": "x", "as": "new"}}] } ');
document
---------------------------------------------------------------------
- { "_id" : { "$numberInt" : "1" }, "a" : [ { "$numberInt" : "10" }, { "$numberInt" : "10" } ], "x" : { "$numberInt" : "5" }, "distance" : { "$numberDouble" : "1491297.403229492018" }, "new" : [ { "_id" : { "$numberInt" : "5" }, "foo" : "bar", "a" : [ { "$numberInt" : "5" }, { "$numberInt" : "5" } ], "x" : { "$numberInt" : "5" } } ] }
+ { "_id" : { "$numberInt" : "1" }, "a" : [ { "$numberInt" : "10" }, { "$numberInt" : "10" } ], "x" : { "$numberInt" : "5" }, "distance" : { "$numberDouble" : "1491297.4032294917852" }, "new" : [ { "_...
|
||
|
|
0f84538074 |
Merged PR 1639495: [engine][collation] Support for $documents and $replaceWith
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support for $documents and $replaceWith operations with collation in the aggregation pipeline. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for collation with `$documents` and `$replaceWith` aggregation stages. - Added collation support for `$documents` and `$replaceWith` stages in `bson_aggregation_pipeline` in `bson_dollar_ops_collation_tests_runtime.out` and `bson_dollar_ops_collation_tests_runtime.sql`. - Updated `pg_documentdb/src/aggregation/bson_aggregation_nested_pipeline.c` to handle collation strings in the context. - Updated documentation in `docs/release_notes/pgmongo_1.103.md` and `oss/CHANGELOG.md` to reflect the new features. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #4095421, #4095425 |
||
|
|
f97fd41b6a |
Merged PR 1640786: [Wildcard | Gin] Miscellaneous index improvements
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Perf ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1) For wildcard term generation, we were iterating every array twice (once for the array term and once for the array path term). Instead, iterate the array once and generate the terms together 2) We were also enumerating every array a 3rd time to count the keys - estimate key term count by using a log2(size) 3) Add the new stages for currentOp index tracking 4) Use dynamic_library_path to avoid specifying load library path in hosted environments (this also fixes parallel build for the internal index POC) ---- #### AI description (iteration 1) #### PR Classification Code cleanup and performance improvement. #### PR Summary This pull request focuses on improving the indexing mechanism for BSON documents in the Gin index. - `bson_gin_core.c`: Refactored `GenerateTermsCore` function to split logic into `GenerateArrayPath` and `GenerateTermPath` for better readability and maintainability. - Enhanced term generation for arrays and nested documents to optimize index lookup and query performance. - Improved memory management by using `StringInfo` for path construction and ensuring proper buffer allocation. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
4da81c67e6 |
Merged PR 1588632: [engine][collation] Support for Aggregation, Find, Query Match on Sharded Collections
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation for aggregation and query match queries on sharded collections. If the `shard key filter` is collation-aware, we make the query distributed and push it to all shards. ---- #### AI description (iteration 1) #### PR Classification New feature: Collation support for aggregation and query match on sharded collections. #### PR Summary This pull request adds collation support for aggregation and query match operations on sharded collections. - `bson_dollar_ops_collation_tests_runtime.sql`: Added tests for collation-aware shard key queries. - `sharding.c`: Introduced logic to track collation-aware shard key fields and updated related functions. - `query_operator.c`: Modified to include shard key filters only if they are not collation-sensitive. - `bson_aggregation_pipeline.c`: Added collation-aware checks for shard key filters in aggregation pipelines. - `bson_query.h`: Added utility function `IsBsonTypeCollationAware` to check if BSON types are collation-aware. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3915171, #3922023 |
||
|
|
6349b5adca |
Merged PR 1633710: [Composite POC] Improve performance on multi-key path scenarios
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Perf ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description For multi-key paths, track them on insert/update. When doing a query, check the index for multi-key paths - if there are any then rewrite the query differently. ---- #### AI description (iteration 1) #### PR Classification Performance improvement for multi-key path scenarios in composite indexes. #### PR Summary This pull request enhances the performance of multi-key path scenarios by introducing optimizations and refactoring the handling of composite indexes. - `oss/pg_documentdb/src/index_am/rum.c`: Introduced `IndexMultiKeyStatus` enum and `CheckIndexHasArrays` function to optimize index scans. - `oss/pg_documentdb/src/opclass/bson_gin_composite_core.c` and `oss/pg_documentdb/src/opclass/bson_gin_composite_entrypoint.c`: Added functions to merge single variable bounds and parse composite query specifications. - `oss/pg_documentdb/include/index_am/documentdb_rum.h`: Updated function signatures to use `IndexAmRoutine` pointers. - `pgmongo/src/helio_gin_am/helio_gin_utils.c`: Adjusted function calls to use `IndexAmRoutine` pointers. - `pgmongo/src/metadata/oid_cache.c`: Changed `missingOk` parameter to `true` in `RunIndexOpAsUserProcedureId`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
b657d1057e |
Merged PR 1633206: [Composite POC] Fix correctness in composite op class
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature/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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Fix up diff and correctness issues with the composite op class - Fix $range correctness with arrays - Fix type bracketing for $range - Fix term generation for numbers. ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request addresses correctness issues in the composite operation class. - `bson_gin_composite_entrypoint.c`: Improved handling of truncation and scan keys in `gin_bson_composite_path_consistent` and `gin_bson_composite_path_extract_query`. - `bson_gin_composite_core.c`: Enhanced `UpdateRunDataForVariableBounds` to correctly handle term mapping and bounds. - `bson_query_operator_tests_index_composite.out`: Updated expected test results to reflect the corrected behavior. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
2a55448755 |
Merged PR 1633198: [hotfix] creation_time column hotfix
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description [hotfix] disabing creation time changes for this release train ---- #### AI description (iteration 1) #### PR Classification Bug fix to address issues with the `creation_time` column during upgrades. #### PR Summary This pull request introduces a hotfix to manage the `creation_time` column during complete upgrades. - Added a new feature flag `alterCreationTimeInCompleteUpgrade` in `configs/feature_flag_configs.c`. - Modified `cluster_operations.c` to conditionally alter `creation_time` based on the new feature flag. - Updated test files `extension_upgrade_alter_creation_time_1.102-0.sql` and `extension_upgrade_alter_creation_time_1.102-0.out` to set the new feature flag during tests. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
77f9dc3b75 |
Merged PR 1631702: [Composite POC] Add Basic tests for Composite Index OpClass
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Testing ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Enable query_operator_tests for composite index op-class Found 2 minor bugs that's fixed Found issues in the existing tests that didn't use index in certain cases. Fix that too. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds basic tests for Composite Index OpClass. - Changes in `src/opclass/bson_gin_composite_core.c` include the addition of multiple functions to handle various BSON strategies (`$all`, `$in`, `$nin`, bitwise operators, `$type`, etc.) and error handling improvements. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
4c0942ce13 |
Merged PR 1612078: [engine][collation] Support for Complex Locale
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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 Support advanced locales ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces a collation add-on to enhance locale and collation type handling in the collation module. - `collation.c`: Added support for parsing and handling collation types within locale strings, including replacing underscores with hyphens. - `bson_dollar_ops_collation_tests_runtime.out`: Added new test cases to validate collation functionality with various locales and collation types. - `bson_dollar_ops_collation_tests_runtime.sql`: Updated SQL test scripts to include new collation scenarios and validate query matching with different collation settings. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
d4f127106a |
Merged PR 1574869: [engine][compat] BinData Conversion to/from String
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### 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? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support conversion to binData from string and vice versa.
$convert to BinData
```
"$convert": {
"input": <string>,
"to": {
"type": "binData",
"subtype": <bson_subtype_t>
},
"format": <"base64"/"string"/"hex"/"uuid"/"base64url">
}
```
OR
```
--- subtype will default to 0
"$convert": {
"input": <string>,
"to": "binData",
"format": <"base64"/"string"/"hex"/"uuid"/"base64url">
}
```
BinData $toString
```
{ $toString: <binData expression> }
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request introduces support for converting data to `BinData` using the `$convert` operator.
- `src/operators/bson_expression_type_operators.c`: Added new functions and modified existing ones to handle `BinData` conversion, including `ProcessDollarToBinData`, `GetToTypeAndSubTypeForBinDataConversion`, and `ValidateAndGetBinDataConversionSubTypeAndFormat`.
- Refactored `ParseDollarConvert` and `ApplyDollarConvert` to accommodate the new `BinData` conversion logic.
- Introduced a new struct `ConvertToTypeArguments` to manage conversion arguments.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
|
||
|
|
2c07ff0014 |
Merged PR 1625609: [DocumentDB] Add documentdb version 0.102-1 hotfix that is an idempotent upgrade of 0.102-0
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfix(ish) ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 0.102-0 had changes that are non-idempotent. Given there were some incorrect dependencies taken on the 0.102 release (independently) introduce a 0.102-1 version that applies all the delta of 0.102-0 in an idempotent manner so that dependencies taken partially on 0.102 and dependencies taken on 0.102 fully work side-by-side. ---- #### AI description (iteration 1) #### PR Classification Hotfix for DocumentDB version upgrade. #### PR Summary This pull request introduces a hotfix for DocumentDB, ensuring an idempotent upgrade from version 0.102-0 to 0.102-1. - Added `documentdb--0.102-0--0.102-1.sql` to handle partial upgrades and repeat UDF upgrades. - Modified `data_table_utils.c` to check for both 0.102-0 and 0.102-1 versions during data table upgrades. - Updated `pgmongo.control` to set the default version to 1.102-1. - Added `pgmongo--1.102-1--1.103-0.sql` for version transition. - Updated SHA1 checksums in multiple `pgmongo/sql/sha1` files to reflect changes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
840128724c |
Merged PR 1625449: Fix up issues with shard rebalance grant support
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Fix up issues with rebalance grant support - make rebalance_start/stop/status work for the admin user. ---- #### AI description (iteration 1) #### PR Classification Bug fix #### PR Summary This pull request addresses issues with shard rebalance grant support by updating table ownership and schema usage permissions. - `cluster_operations.c`: Added function to update the owner of the changes table to the cluster admin role and integrated it into the cluster setup process. - `pgmongo--1.102-0--1.103-0.sql`: Granted usage on the `helio_api_distributed` schema to `pgmongo_role` and `helio_admin_role`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
338e1dc6ef |
Merged PR 1622609: [Query Perf] Improve performance of index pushed down large $in queries
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Perf ### 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 Improve the consistent function performance for $in in the index. ---- #### AI description (iteration 1) #### PR Classification Performance improvement #### PR Summary This pull request improves the performance of index pushed down large `$in` queries by introducing a fast path for certain conditions. - `bson_gin_core.c`: Added a fast path for `$in` queries without truncation, nulls, or regex. - `feature_flag_configs.c`: Introduced a new feature flag `EnableRumInOperatorFastPath`. - Updated regression tests in `regex.sql` and `regex.out` to include scenarios for the new fast path feature. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
580a0a89b6 |
Merged PR 1615448: Version update for 102 release
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Version update for 102 release |
||
|
|
f31e0b6cad |
Merged PR 1615832: Support for pushdown of in to PFE indexes
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support for pushdown of to PFE indexes ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for pushdown operations to PFE indexes, enhancing query performance and index utilization. - Added new functions in `sql/udfs/index_mgmt/bson_indexbounds_functions--0.102-0.sql` for BSON index bounds operations. - Introduced new operators in `sql/operators/bson_btree_pfe_operators--0.102-0.sql` for BSON and BSON query comparisons. - Updated `src/query/query_operator.c` to handle new index bounds operators and expressions. - Added new type definitions in `sql/types/bsonindexbounds--0.102-0.sql` for BSON index bounds. - Modified `src/metadata/metadata_cache.c` to include OIDs and functions for BSON index bounds types and operators. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
80df5a1509 |
Merged PR 1604750: [perf][creation_time] Alter creation time : part 1
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Altering creation_time column removing not null and default constraint. ---- #### AI description (iteration 1) #### PR Classification Performance improvement #### PR Summary This pull request alters the `creation_time` column in the database schema to improve performance. - Added `AlterCreationTime` function in `cluster_operations.c` to modify the `creation_time` column. - Updated `SetupCluster` function in `cluster_operations.c` to call `AlterCreationTime`. - Created new SQL scripts `extension_upgrade_alter_creation_time_1.102-0.sql` and `extension_upgrade_alter_creation_time_1.102-0.out` for testing the changes. - Modified multiple test output files to reflect the changes in the `creation_time` column constraints. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
5a8db3494c |
Merged PR 1614043: [Operator] Support extended $getfield for 8.0
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support new syntax of $getField ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the extended `$getField` operator for version 8.0. - Added new test file `postgresjs/expression_get_field_80_custom.js` to validate `$getField` operator behavior. - Updated `bson_expression_object_operators.c` to handle new error codes and validation for `$getField`. - Modified `bson_aggregation_object_operators_tests.sql` and related expected output files to include new test cases for `$getField`. - Added new error code mappings in `documentdb_errors.csv` and `error_mappings.csv`. - Updated `documentdb_codes.txt` and `mongo_codes.csv` to include new error codes. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
86ce366053 |
Merged PR 1556142: DateFromString part-2: Add more functionalities to $dateFromString and make JS tests pass
### Does this PR have any customer impact? Yes, this PR improve the ability of $dateFromString. ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) N/A ### Are you introducing any new config? If yes, do you have tests with and without them being set? N/A ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) N/A (need to confirm later) ### Description 1. Add support to infer date format automatically if the field `format` is not specified. 2. Add support for some wacky format. 3. Add support for more timezone format. 3. Fix some corner case when processing null/empty values both in `format` and `inputString` 3. Make JS test passed for date_from_string.js ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces new functions to parse and validate date strings based on various formats. - `oss/pg_documentdb/src/operators/bson_expression_date_operators.c`: Added `VerifyAndParseFormatStringToParts` and several helper functions to handle different date formats and validate date parts. - Defined new constants for timezone mappings and preset date format parsers. |
||
|
|
399e01d954 |
Merged PR 1539417: [Operator] $toUUID in Mongo 8.0
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md)) ### Description support $toUUID operator ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request introduces the `$toUUID` operator for MongoDB 8.0, enabling conversion of strings to UUIDs. - Added `ProcessDollarToUUID` function in `bson_expression_type_operators.c` to handle the conversion logic. - Updated `bson_expression_operators.h` to declare new parsing and handling functions for `$toUUID`. - Included new test cases in `bson_aggregation_type_operators_tests.sql` and `bson_aggregation_type_operators_tests.out` to validate the `$toUUID` functionality. - Modified `feature_counter.h` and `feature_counter.c` to include the new `$toUUID` feature in the feature count and mapping. |
||
|
|
38af796840 |
Merged PR 1612052: [Infra] Delete Helio test files, Reduce index build wait time
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description ---- #### AI description (iteration 1) #### PR Classification Code cleanup #### PR Summary This pull request cleans up the codebase by removing obsolete test files and updating configuration parameters for index build wait times. - Deleted multiple obsolete test files across `pg_helio_api`, `pg_helio_core`, and `pg_helio_distributed` directories. - Updated `TenantConfigurationBase.cs` to change index build wait time from seconds to milliseconds. - Modified `pgmongo.c` to update index build wait time configuration from seconds to milliseconds. - Adjusted `dynamic.rs` and `indexing.rs` to reflect the change in index build wait time units. - Updated `PostgresMongoClient.cs` to use milliseconds for index build wait time. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
98a5603d64 |
Merged PR 1594069: [engine][collation] Support for find
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation with `find` queries. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the `project find` functionality with collation in the engine. - Added new SQL functions in `sql/udfs/projection/bson_projection--0.102-0.sql` for handling BSON projection with collation. - Updated `metadata_cache.c` to include OID caching for the new `bson_dollar_project_find` function with collation. - Modified `bson_project.c` to handle additional arguments for collation in the `bson_dollar_project_find` function. - Updated `bson_projection--latest.sql` to include the new function definition. - Added function declaration in `metadata_cache.h` for the new `bson_dollar_project_find` function with collation. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3924476 |
||
|
|
70887c4a1a |
Merged PR 1601128: [engine][collation] Support for replaceRoot
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation for `replaceRoot` aggregation stage ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the `$replaceRoot` operation with collation in the BSON aggregation pipeline. - `bson_projection--0.102-0.sql` and `bson_projection--latest.sql`: Added new function `bson_dollar_replace_root` with collation support. - `metadata_cache.c` and `metadata_cache.h`: Added OID cache and retrieval function for the new `bson_dollar_replace_root` with collation. - `bson_project.c`: Updated `bson_dollar_replace_root` to handle collation. - `bson_aggregation_pipeline.c`: Integrated collation handling in `HandleReplaceRoot`. - Updated test files to include new test cases for `$replaceRoot` with collation. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
7d31ca16ff |
Merged PR 1605959: [Index Changes] A few fixes for background indexing for blocking & pruning old indexes
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Bugfixes ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1) Support blocking background index which will do a non-concurrent index create 2) Delete dead code in the gW for background blocking index 3) Show queued index builds in currentOp 4) Prioritize pruning old skippable indexes in the queue. ---- #### AI description (iteration 1) #### PR Classification Bug fix for background indexing. #### PR Summary This pull request addresses several issues related to background indexing, including handling skippable index requests and improving logging. - `index.c`: Added function `GetSkippableRequestFromIndexQueue` to fetch skippable index requests. - `create_indexes_background.c`: Implemented `PruneSkippableIndexes` to remove stale index requests and updated `command_build_index_concurrently` to prioritize pruning. - `PostgresMongoClient.cs`: Removed temporary fix for blocking createIndexes requests. - `current_op.c`: Enhanced `AddFailedIndexBuilds` to include queued index builds. - Updated test files to reflect changes in index queue handling and logging. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
48326a678d |
Merged PR 1606155: [Cleanup] Delete old code - Delete default Feature flags and old code no longer exercised
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Refactoring ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Delete default on feature flags and old code ---- #### AI description (iteration 1) #### PR Classification Code cleanup #### PR Summary This pull request removes old and unused code, including default feature flags and unexercised code paths. - `PostgresClient.cs`: Removed conditional logic and associated methods for handling feature flags and old code paths. - `feature_flag_configs.c`: Deleted definitions and initializations of deprecated feature flags. - `bson_aggregation_pipeline_tests_point_read.out` and `bson_aggregation_pipeline_tests_point_read.sql`: Removed test cases related to deprecated feature flags. - `commands_common.c`: Removed conditional check for backend statement timeout feature flag. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
b7606c8115 |
Merged PR 1605600: Fix densify for PG17
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) BugFix ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description PG 17 estimates the cost of Window clauses now based on the approximate number of rows and for that it needs valid frameoptions ---- #### AI description (iteration 1) #### PR Classification Bug fix for compatibility with PostgreSQL 17. #### PR Summary This pull request addresses a bug in the densify function for PostgreSQL 17. - `oss/pg_documentdb/src/aggregation/bson_densify.c`: Added `FRAMEOPTION_DEFAULTS` to `winClause->frameOptions` to ensure proper window function handling. - `oss/internal/pg_documentdb_distributed/src/test/regress/test_mutate_17`: Removed unnecessary test cases related to bson aggregation pipeline stages. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
58e9029fab |
Merged PR 1590489: top level let support with $geoNear stage
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) - Support top level let variables in $geoNear stage ### Description Support top level let variables in $geoNear stage - Today there are 2 scenarios where `let` is used with $geoNear 1- `top level`: Any `let` provided in the top level command such as `aggregate`, the variables used in geonear spec should result into a `constant`, so we evaluate and rewrite the geoNear spec before parsing it to replace any expressions/let variables from top level let. 2- `nested let`: This scenario occurs with lookup pipeline and let is a combination of top level let and lookup let, this case is not optimized in this PR and will still return in error ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for top-level `let` expressions within the `$geoNear` stage in aggregation pipelines. - `oss/pg_documentdb/src/aggregation/bson_aggregation_pipeline.c`: Added logic to handle `let` expressions by updating the `$geoNear` specification if a `CONST let` expression is present in the context. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
b2ef1f3663 |
Merged PR 1585449: [json schema] enable $jsonSchema in query command
### Does this PR have any customer impact? Yes ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description 1. enable `$jsonSchema` working in command query 2. support schema validation in `findAndModify` 3. enable 3 js tests to pass ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request enables the use of `$jsonSchema` in commands and includes schema validation. - `query_operator.c`: Removed restriction on `$jsonSchema` usage and added schema validation logic. - `feature_flag_configs.c`: Enabled schema validation and bypass document validation by default. - `bson_json_schema_tree.c`: Added logging for parsing `$jsonSchema` keywords. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
d1b099258b |
Merged PR 1591622: [engine][collation] Support for addFields & set
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes) Yes ### Are you introducing any new config? If yes, do you have tests with and without them being set? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation for `$addFields` and `$set` aggregation stages ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for the `addFields` operation with collation in the aggregation pipeline. - `bson_project.c`: Added collation support to `bson_dollar_add_fields` and related functions. - `bson_expression_comparison_operators.c`: Updated comparison operators to handle collation. - `bson_dollar_operators.c`: Enhanced query state population to include collation. - Test files `bson_dollar_ops_collation_tests_runtime.out` and `bson_dollar_ops_collation_tests_runtime.sql`: Added tests for collation with `$expr` and `$addFields`. - `bson_projection--latest.sql`: Added new function definition for `bson_dollar_add_fields` with collation. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3919349, #3919367 |
||
|
|
1341b552af |
Merged PR 1599232: [engine][collation] Support for Set Operators
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation with `$setEquals`, `$setUnion`, `$setIntersection`, `$setDifference`, `$setIsSubet` in the aggregation pipeline. ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for collation in set operators. - `collation.c`: Added `HashStringWithCollation` function to hash strings with collation. - `bson_expression_set_operators.c`: Introduced collation handling in set operator states and comparison functions. - `bson_dollar_ops_collation_tests_runtime.sql`: Added tests for `$setEquals` with collation. - `collation.h`: Declared `HashStringWithCollation` function. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> |
||
|
|
90c92c44ec |
Merged PR 1591616: [engine][collation] Support for project
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description more ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for collation in BSON projection functions. - Added new SQL functions in `sql/udfs/projection/bson_projection--0.102-0.sql` to handle collation. - Updated `src/aggregation/bson_project.c` to include collation string handling in BSON projection. - Modified `src/aggregation/bson_aggregation_pipeline.c` to support collation in projection stages. - Enhanced `src/query/bson_dollar_operators.c` to populate collation string in query state. - Added collation-related tests in `sql/bson_dollar_ops_collation_tests_runtime.sql`. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3918941 |
||
|
|
8bf9489e33 |
Merged PR 1592819: [engine][collation] Support for redact
### 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? ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description more ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds support for collation in the redact function. - `bson_project.c`: Added handling for an additional collation string argument in the `bson_dollar_redact` function. - `bson_aggregation_redact--0.24-0.sql` and `bson_aggregation_redact--latest.sql`: Updated to include the new collation string parameter in the `bson_dollar_redact` function definition. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3919400 |
||
|
|
e679d4f858 |
Merged PR 1588576: [engine][let] Support for Query Match
### Does this PR have any customer impact? No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature
### 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? No
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))
### Description
Support the use `let` variables (and system variables) in the `query` for `bson_query_match`.
Variables can only be accessed in a `$expr` expression.
Example:
```
SELECT documentdb_api_internal.bson_query_match('{"a": "cat"}', '{"$expr": {"a": "$$varRef"} }', NULL, '{"varRef": "cat"}');
```
----
#### AI description (iteration 1)
#### PR Classification
New feature
#### PR Summary
This pull request adds support for the `let` clause in query match operations.
- Added new test cases in `bson_aggregation_pipeline_tests_let.sql` to validate `let` clause functionality.
- Updated `bson_query_match` function in `query_operator.c` to handle `let` clause and collation settings.
- Modified `ReplaceBsonQueryOperatorsMutator` and `ExpandBsonQueryOperator` functions in `query_operator.c` to process variable specifications.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Related work items: #3915179
|
||
|
|
9849d49684 |
Merged PR 1592153: [engine][collation] Support for Array Aggregation Operators
### Does this PR have any customer impact? No ### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc) Feature ### 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? No ### ChangeLog (Refer [Template](../oss/CHANGELOG.md)) ### Description Support collation for comparisons in evaluating `$in` expressions in an aggregation ---- #### AI description (iteration 1) #### PR Classification New feature #### PR Summary This pull request adds collation support for array operators, specifically for `$in` and `$filter`. - `bson_expression_array_operators.c`: Refactored `ProcessDollarIn` to handle collation and updated related functions. - `bson_expression_comparison_operators.c`: Added collation handling in `ParseComparisonOperator`. - Added new test cases in `bson_dollar_ops_collation_tests_runtime.sql` and corresponding expected output files to validate collation support for array operators. <!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot --> Related work items: #3919345 |