### Known limitations & TODO for part 2 - [ ] The current implementation intersects results from both vector index and bitmap index, it is actually the post-filtering - [ ] Not work for sharded collection ### Part 1 explain result  ### New explain result  From mongo command: ``` SELECT document FROM bson_aggregation_pipeline('db', ' { "aggregate": "aggregation_pipeline_ivf_filter", "pipeline": [ { "$search": {"cosmosSearch": { "vector": [ 3.0, 4.9, 1.0 ], "k": 4, "path": "v", "filter": { "a": "some sentence" }, "nProbes": 1 } } } ], "cursor": {} }'); ``` To psql command ``` 1. SELECT c1(search query): SELECT document, (public.vector(mongo_catalog.bson_extract_vector(collection.document, 'v'::text), 3, true) OPERATOR(public.<=>) public.vector(mongo_catalog.bson_extract_vector('{ "vector" : [ { "$numberDouble" : "3.0" }, { "$numberDouble" : "4.9000000000000003553" }, { "$numberDouble" : "1.0" } ], "k" : { "$numberInt" : "1" }, "path" : "v" }'::mongo_catalog.bson, 'vector'::text), 3, true)) AS orderVal, ctid FROM mongo_data.documents_1 collection WHERE shard_key_value = 0 AND ((mongo_catalog.bson_extract_vector(collection.document, 'v'::text) IS NOT NULL)) ORDER BY (public.vector(mongo_catalog.bson_extract_vector(collection.document, 'v'::text), 3, true) OPERATOR(public.<=>) public.vector(mongo_catalog.bson_extract_vector('{ "vector" : [ { "$numberDouble" : "3.0" }, { "$numberDouble" : "4.9000000000000003553" }, { "$numberDouble" : "1.0" } ], "k" : { "$numberInt" : "1" }, "path" : "v" }'::mongo_catalog.bson, 'vector'::text), 3, true)) 2. SELECT c2(filter query): SELECT ctid FROM mongo_data.documents_1 WHERE shard_key_value = 0 AND document @@ '{ "a": "some sentence" }' 3. JOIN c1 ON c1.ctid = c2.ctid SELECT c1.document FROM c1 JOIN c2 ON c2.ctid = c1.ctid ORDER BY c1.orderVal LIMIT 1 ``` Related work items: #2586299
Project
This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experience for community-building.
As the maintainer of this project, please make a few updates:
- Improving this README.MD file to provide a great experience
- Updating SUPPORT.MD with content about this project's support experience
- Understanding the security reporting process in SECURITY.MD
- Remove this section from the README
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Trademarks
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.