-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Automatically catch missing team_id filters #3085
Labels
Comments
This was referenced Jan 26, 2021
macobo
added a commit
that referenced
this issue
Feb 18, 2021
Tested out a solution for #3085 - result is super noisy but helped me find some bad queries.
macobo
added a commit
that referenced
this issue
Feb 19, 2021
Tested out a solution for #3085 - result is super noisy but helped me find some bad queries.
This issue hasn't seen activity in two years! If you want to keep it open, post a comment or remove the |
This issue was closed due to lack of activity. Feel free to reopen if it's still relevant. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem?
Missing team_id filters can cause havoc, causing performance (and correctness problems) in queries.
Reviews can't catch all of them since sometimes unexpected tables have team_id filters or we might forget to push the filters into subqueries.
It would be great if we could avoid them.
Describe the solution you'd like
Let's add heuristics to avoid these errors.
A simple heuristic would be to count number of tables selected from/joined (X) with a team_id column and compare it against number of team_id filters (Y).
After each test it could confirm for all queries X <= Y
Describe alternatives you've considered
Make reviewers perfect.
Additional context
Related PRs: #3084 #2299 #2276 https://github.com/PostHog/posthog/pull/1967/files etc
Hacky proof-of-concept for Django ORM queries:
Thank you for your feature request – we love each and every one!
The text was updated successfully, but these errors were encountered: