-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Optimize tag permissions #126
Conversation
The new implementation generates a subquery of IDs instead of sending big arrays of data to/from the database. This massively speeds up performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to look into the new query, but here are a few initial comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing locally everything seems to be working OK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query looks good as far as I can tell.
The new implementation generates a subquery of IDs instead of sending big arrays of data to/from the database. This massively speeds up performance.
The new implementation generates a subquery of IDs instead of sending big arrays of data to/from the database. This massively speeds up performance.
Currently, to check the tags where users have permissions, we:
whereIn
.This is quite slow. Instead of doing this, this PR creates a subquery for all tags where a user has a permission, then feeds that subquery to
whereIn
s. Combined with #87, this makes a setup with:have negligible effects on initial page load.
Most of this PR is tests, don't be scared of the line changes!