diff options
Diffstat (limited to 'doc/development/query_count_limits.md')
-rw-r--r-- | doc/development/query_count_limits.md | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/development/query_count_limits.md b/doc/development/query_count_limits.md index 07dcb6c7d90..a9569fee8cc 100644 --- a/doc/development/query_count_limits.md +++ b/doc/development/query_count_limits.md @@ -1,13 +1,13 @@ --- stage: none group: unassigned -info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- # Query Count Limits Each controller or API endpoint is allowed to execute up to 100 SQL queries and -in test environments we'll raise an error when this threshold is exceeded. +in test environments we raise an error when this threshold is exceeded. ## Solving Failing Tests @@ -20,18 +20,18 @@ solutions to this problem: You should only resort to whitelisting when an existing controller or endpoint is to blame as in this case reducing the number of SQL queries can take a lot of effort. Newly added controllers and endpoints are not allowed to execute more -than 100 SQL queries and no exceptions will be made for this rule. _If_ a large +than 100 SQL queries and no exceptions are made for this rule. _If_ a large number of SQL queries is necessary to perform certain work it's best to have this work performed by Sidekiq instead of doing this directly in a web request. ## Whitelisting -In the event that you _have_ to whitelist a controller you'll first need to +In the event that you _have_ to whitelist a controller you must first create an issue. This issue should (preferably in the title) mention the controller or endpoint and include the appropriate labels (`database`, `performance`, and at least a team specific label such as `Discussion`). -Once the issue has been created you can whitelist the code in question. For +After the issue has been created you can whitelist the code in question. For Rails controllers it's best to create a `before_action` hook that runs as early as possible. The called method in turn should call `Gitlab::QueryLimiting.whitelist('issue URL here')`. For example: |