Files
documentdb/pg_documentdb
Vinod Sridharan 69f291ab31 Merged PR 1692865: Support pushdown of with shard keys specified with $in
### Does this PR have any customer impact?
Yes
### 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?
Yes
### ChangeLog (Refer [Template](../oss/CHANGELOG.md))

### Description
In a distributed set up, shard keys specified with $and/$eq/$or were tracked but not $in. This adds support for $in as well in pushdown.

----
#### AI description  (iteration 1)
#### PR Classification
New feature to enhance sharding by supporting pushdown of queries with shard keys specified using the $in operator.

#### PR Summary
This pull request extends the sharding logic to process $in operator predicates for shard keys, optimizing query routing and pushdown.
- `oss/pg_documentdb/src/sharding/sharding.c`: Added new helper functions (e.g., FindShardKeyValuesExprPhase1, ConsiderShardKeyFiltersForInClauses, and FindShardKeyValuesExprNew) and refactored shard key handling to use a new `ShardKeyMetadata` structure with updated `setCount` tracking.
- `oss/pg_documentdb/src/configs/feature_flag_configs.c`: Introduced the `UseNewShardKeyCalculation` flag to enable the new shard key calculation logic.
- Test files and SQL regression scripts: Updated expected outputs and queries to validate the new $in operator support for shard key pushdown.
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
2025-06-05 10:31:32 +08:00
..