Vinod Sridharan
0e156314f6
Merged PR 1282170: [PG16] Enable building the extension with PG16
...
### Does this PR have any customer impact?
No
### Type (Feature, Refactoring, Bugfix, DevOps, Testing, Perf, etc)
Infra
### Does it involve schema level changes? (Table, Column, Index, UDF, etc level changes)
No
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
### Description
Part 1: Enable building the extension and fix up pieces for building with PG16.
With this the core extension builds with PG16 and *most* of the backend tests pass. At this point, checking this in as a checkpoint (to ensure compat is retained) as more features are lit up with PG16
One thing to note is PG16 builds changes the default visibility of exports to 'private' that means that to make the current build work, we need to override that to 'default/public'. This needs to be fixed but is left as-is currently to make incremental progress.
There were some attempts to create exports in the code that are left as-is
2024-03-01 17:24:28 +03:00
Zinan Ren 🐾
69118d324f
Merged PR 1246367: [Vector Search] Support pre-filtering in search - Part 2
...
### 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
2024-02-07 23:20:07 +03:00
Vinod Sridharan
da2c098f3c
Merged PR 1265302: Make sh.status() work
...
### 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
### Release Note (Refer [Template](../docs/release_notes/pgmongo_template.md))
Make sh.status() work in mongo shell.
### Description
sh.status() used to return

With these changes, this now looks like:

2024-02-07 23:20:07 +03:00