Skip to content

Generalize indexing of planner rules to support multiple concrete classes per rule#4254

Draft
RobertBrunel wants to merge 2 commits into
FoundationDB:mainfrom
RobertBrunel:TypedMatcher
Draft

Generalize indexing of planner rules to support multiple concrete classes per rule#4254
RobertBrunel wants to merge 2 commits into
FoundationDB:mainfrom
RobertBrunel:TypedMatcher

Conversation

@RobertBrunel

Copy link
Copy Markdown
Contributor

Experimental.

@RobertBrunel RobertBrunel self-assigned this Jun 4, 2026
…sses per rule

* Generalize `PlannerRule.getRootOperator()` to `getRootOperators()`, which returns a set of classes.
* Also add a `BindingMatcher.getRootClasses()` counterpart, which defaults to `Set.of(getRootClass()))`.
* In `AbstractRuleSet`, have each rule indexed under each class it advertises via `getRootOperators()`.
* Add a `MultiTypedMatcher` and a corresponding `ValueMatchers.anyValueOfType(…)` wrapper that utilize the multi-class indexing to efficiently bind a union of concrete subclasses.
* Leverage `anyValueOfType()` in `CollapseNullStrictValueOverNullValueRule` to remove it from the always-rules bucket and efficiently match exactly the six strict-null-propagating `Value` subclasses that matter.
@RobertBrunel RobertBrunel added enhancement New feature or request performance Performance issues labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request performance Performance issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant