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

Query Optimizer #37

Open
bounoable opened this issue Apr 2, 2022 · 0 comments
Open

Query Optimizer #37

bounoable opened this issue Apr 2, 2022 · 0 comments

Comments

@bounoable
Copy link
Contributor

bounoable commented Apr 2, 2022

An idea that came to my mind:

package example

func example(q1, q2 event.Query) {
  if query.IsSupersetOf(q2, q1) {
    log.Println("first query would return all events that the second query would return, and possibly more")
  }
}

If this could be implemented, projection jobs could further optimize queries for each individual projection. When a job applies itself onto multiple projections, it can check if a query that ran previously is a superset of the current query, and if so, just return the cached result from the previous query.

A query q1 is a superset of another query q2 if each of q1's filters/constraints is either less or equally restricting than q2's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant