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 possible for intersections #1595

Open
1 task done
miparnisari opened this issue May 3, 2024 · 0 comments
Open
1 task done

optimization possible for intersections #1595

miparnisari opened this issue May 3, 2024 · 0 comments
Labels
enhancement New feature or request performance

Comments

@miparnisari
Copy link
Member

miparnisari commented May 3, 2024

Checklist

Describe the problem you'd like to have solved

With a model such as

model
  schema 1.1

type user

type account

type document
  relations
    define a: [user]
    define b: [account]
    define intersection: a and b
    define intersection_2: b and a

any queries of the form

Check(user:...., intersection_2, document:...)
Check(user:...., intersection, document:...)

can be optimized based on the fact that intersection([user], [account]) == {}

image

Describe the ideal solution

We compute the terminal types of an intersection and if len(terminal_types)==0 we can return allowed=false immediately.

Alternatives and current workarounds

No response

Additional context

No response

@miparnisari miparnisari added enhancement New feature or request performance labels May 3, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant