-
Notifications
You must be signed in to change notification settings - Fork 74
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
Cinstance N+1 issues clean-up #3889
Draft
akostadinov
wants to merge
13
commits into
3scale:master
Choose a base branch
from
akostadinov:bullets
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on Sep 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for c16f40d - Browse repository at this point
Copy the full SHA c16f40dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ed62c9 - Browse repository at this point
Copy the full SHA 8ed62c9View commit details -
Bullet optimization of Admin::Api::ApplicationsController
``` Bullet::Notification::UnoptimizedQueryError: user: localuser GET http://admin.foo.3scale.localhost:39073/p/admin/applications/16 AVOID eager loading detected ApplicationPlan => [:plan_metrics] Remove from your query: .includes([:plan_metrics]) ```
Configuration menu - View commit details
-
Copy full SHA for f788d8d - Browse repository at this point
Copy the full SHA f788d8dView commit details -
UnoptimizedQuery ApplicationPlan => [:original]
Fixes issue with keys.feature:Regenerate provider key Bullet::Notification::UnoptimizedQueryError: user: avalon PUT http://master-account.3scale.localhost:42285/p/admin/applications/4/change_user_key AVOID eager loading detected ApplicationPlan => [:original] Remove from your query: .includes([:original])
Configuration menu - View commit details
-
Copy full SHA for 634e6ec - Browse repository at this point
Copy the full SHA 634e6ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for 081a8c4 - Browse repository at this point
Copy the full SHA 081a8c4View commit details -
eager loading :default_application_plan of Service
``` Bullet::Notification::UnoptimizedQueryError: user: default GET /admin/api/applications.json?provider_key=***&inactive_since=2014-05-05 AVOID eager loading detected Service => [:default_application_plan] Remove from your query: .includes([:default_application_plan]) ```
Configuration menu - View commit details
-
Copy full SHA for 37a6b21 - Browse repository at this point
Copy the full SHA 37a6b21View commit details -
The `#where_values_hash` method does not support joins and sub-queries. Originally the `account.provided_cinstances` part was ignored because it was JOINs. With the update to sub-queries, it turned into `plan_id: nil` which is incorrect and broke the logic. So now we keep logic as previously by resorting only to the `Cinstance.permitted_for` part of the query. This relies on the fact that `Cinstance.plan.issuer` is set as `Cinstance.service` when that issuer is a service. Also relies on the fact that `User.member_permission_service_ids` will not set to ids of services that don't belong to the account. Which may not be ideal but allows for permission checking without extra database queries.
Configuration menu - View commit details
-
Copy full SHA for 4e95548 - Browse repository at this point
Copy the full SHA 4e95548View commit details -
access cinstance service directly not through plan
Historically it was a conscious decision to optimize access to cintance -> service by denormalizing the database. So we can access service directly and not through the plan. We also keep these two in sync with model callbacks. So this commit further simplifies the queries to fully rely on this fact.
Configuration menu - View commit details
-
Copy full SHA for ef6760b - Browse repository at this point
Copy the full SHA ef6760bView commit details
Commits on Sep 13, 2024
-
Configuration menu - View commit details
-
Copy full SHA for aaea00d - Browse repository at this point
Copy the full SHA aaea00dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 82e5492 - Browse repository at this point
Copy the full SHA 82e5492View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01d602c - Browse repository at this point
Copy the full SHA 01d602cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 53d0222 - Browse repository at this point
Copy the full SHA 53d0222View commit details -
Configuration menu - View commit details
-
Copy full SHA for 62b07d9 - Browse repository at this point
Copy the full SHA 62b07d9View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.