Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization for predicates involving contains #101

Merged
merged 56 commits into from
Mar 1, 2025

Conversation

diana-qing
Copy link
Contributor

@diana-qing diana-qing commented Feb 26, 2025

This PR provides some optimizations when processing multiple predicates (where at least one of the predicates uses a contains operator) based on whether the predicates are mutually exclusive or have a parent-child relationship.

Given 2 predicates self and pred:

Mutual exclusivity rules:
self.op is = and pred.op is contains: mutually exclusive iff self.value doesn't contain pred.value

self.op is contains and pred.op is contains: generally not mutually exclusive

self.op is != and pred.op is contains: generally not mutually exclusive

self.op is re and pred.op is contains: generally not mutually exclusive/out of scope since contains can be understood as a regex with wildcards on both sides

Parent-child rules: (parent op must be contains, child op can be = or contains)
If pred.op is contains and self.op is = or self.op is contains, self is a child of pred iff self.value contains pred.value

@diana-qing diana-qing marked this pull request as ready for review February 27, 2025 23:10
@thearossman thearossman merged commit 8977d16 into stanford-esrg:main Mar 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants