Skip to content

Commit f31e0b6

Browse files
visridhashuaitian-git
authored andcommitted
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 -->
1 parent 80df5a1 commit f31e0b6

21 files changed

+981
-355
lines changed

CHANGELOG.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,14 @@
77
* Support current_op command *[Feature]* (#59)
88
* Support for list_databases command *[Feature]* (#45)
99
* Disable analyze statistics for unique index uuid columns which improves resource usage *[Perf]*
10-
* Support collation with $expr *[Feature]*
11-
* Support collation with aggregation $project *[Feature]*
12-
* Support collation with `$cmp`, `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte` comparison operators *[Feature]*
13-
* Support collation with `$in` array operator *[Feature]*
10+
* Support collation with `$expr`, `$in`, `$cmp`, `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte` comparison operators (Opt-in) *[Feature]*
11+
* Support collation in `find`, aggregation `$project`, `$redact`, `$set`, `$addFields`, `$replaceRoot` stages (Opt-in) *[Feature]*
12+
* Support collation with `$setEquals`, `$setUnion`, `$setIntersection`, `$setDifference`, `$setIsSubet` in the aggregation pipeline (Opt-in) *[Feature]*
1413
* Support unique index truncation by default with new operator class *[Feature]*
15-
* Support collation in aggregation `$redact` stage *[Feature]*
16-
* Support collation in aggregation `find` *[Feature]*
17-
* Support collation in aggregation `$set` stage *[Feature]*
18-
* Support collation in aggregation `$addFields` stage *[Feature]*
19-
* Support collation with `$setEquals`, `$setUnion`, `$setIntersection`, `$setDifference`, `$setIsSubet` in the aggregation pipeline *[Feature]*
20-
* Support collation in aggregation `$replaceRoot` stage *[Feature]*
2114
* Top level aggregate command `let` variables support for `$geoNear` stage *[Feature]*
2215
* Enable Backend Command support for Statement Timeout *[Feature]*
2316
* Support type aggregation operator `$toUUID`. *[Feature]*
17+
* Support Partial filter pushdown for `$in` predicates *[Perf]*
2418
* Support the $dateFromString operator with full functionality *[Feature]*
2519
* Support extended syntax for `$getField` aggregation operator. Now the value of 'field' could be an expression that resolves to a string. *[Feature]*
2620

internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_hnsw.out

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

internal/pg_documentdb_distributed/src/test/regress/expected/bson_aggregation_pipeline_tests_vector_ivf.out

Lines changed: 8 additions & 8 deletions
Large diffs are not rendered by default.

internal/pg_documentdb_distributed/src/test/regress/expected/bson_dollar_ops_collation_tests_runtime.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ END;
553553
BEGIN;
554554
SET LOCAL documentdb_core.enablecollation TO on;
555555
EXPLAIN(VERBOSE ON, COSTS OFF)SELECT document FROM bson_aggregation_find('db', '{ "find": "ci_search", "filter": { "a" : {"$in" : [[{ "b" : "caT"}], [{ "c" : "caT"}]] }}, "sort": { "_id": 1 }, "skip": 0, "limit": 100, "collation": { "locale": "en", "strength" : 1} }');
556-
QUERY PLAN
556+
QUERY PLAN
557557
---------------------------------------------------------------------
558558
Limit
559559
Output: remote_scan.document, remote_scan."?sort?"
@@ -565,7 +565,7 @@ EXPLAIN(VERBOSE ON, COSTS OFF)SELECT document FROM bson_aggregation_find('db', '
565565
Task Count: 8
566566
Tasks Shown: One of 8
567567
-> Task
568-
Query: SELECT document, documentdb_api_catalog.bson_orderby(document, '{ "_id" : { "$numberInt" : "1" } }'::documentdb_core.bson) AS "?sort?" FROM documentdb_data.documents_7990_7990016 collection WHERE documentdb_api_catalog.bson_dollar_in(document, '{ "a" : [ [ { "b" : "caT" } ], [ { "c" : "caT" } ] ], "collation" : "en-u-ks-level1" }'::documentdb_core.bson) ORDER BY (documentdb_api_catalog.bson_orderby(document, '{ "_id" : { "$numberInt" : "1" } }'::documentdb_core.bson)) NULLS FIRST LIMIT '100'::bigint
568+
Query: SELECT document, documentdb_api_catalog.bson_orderby(document, '{ "_id" : { "$numberInt" : "1" } }'::documentdb_core.bson) AS "?sort?" FROM documentdb_data.documents_7990_7990016 collection WHERE (documentdb_api_catalog.bson_dollar_in(document, '{ "a" : [ [ { "b" : "caT" } ], [ { "c" : "caT" } ] ], "collation" : "en-u-ks-level1" }'::documentdb_core.bson) AND (document OPERATOR(documentdb_api_internal.##=) ANY ('{"{ \"a\" : [ { \"b\" : \"caT\" } ], \"collation\" : \"en-u-ks-level1\" }","{ \"a\" : [ { \"c\" : \"caT\" } ], \"collation\" : \"en-u-ks-level1\" }"}'::documentdb_api_internal.bsonindexbounds[]))) ORDER BY (documentdb_api_catalog.bson_orderby(document, '{ "_id" : { "$numberInt" : "1" } }'::documentdb_core.bson)) NULLS FIRST LIMIT '100'::bigint
569569
Node: host=localhost port=58070 dbname=regression
570570
-> Limit
571571
Output: document, (documentdb_api_catalog.bson_orderby(document, '{ "_id" : { "$numberInt" : "1" } }'::documentdb_core.bson))

0 commit comments

Comments
 (0)