Boards::IssuesController#bulk_move executes more than 100 queries (7 day: 266 hits, average 349 queries)
rspec ./spec/features/boards/multi_select_spec.rb:77
fails without the query whitelist because it executes more than 100 queries.
In this test, we move 3 issues from one list to another. I saw from the logs that one issue update triggers a lot of SQL queries. Some of those I saw were from validations and webhooks. Updating 3 issues puts us over the limit. I'm not sure if there's anything we can optimize in Issues::UpdateService
to lessen the number of queries.
Another thing I saw was that we are returning the list of issues in Boards::Issues::MoveService#execute_multiple
. I'm not sure if this is necessary. I tried removing this and it reduces the number of queries from 150 to 122 but it's still over the limit.
7 day average is 349 queries. This action would be expected to have a high number of queries by nature of the fact that it is a bulk action, but that may also present the opportunity for drastic reductions if there are any redundant calls happening. It is also not a very highly used endpoint, with 266 hits in the last 7 days.
Percentile breakdown: https://log.gprd.gitlab.net/app/visualize#/edit/5b80e280-8e3b-11eb-a990-d72c312ff8e9?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-1w%2Cto%3Anow))
Saved kibana search: https://log.gprd.gitlab.net/app/discover#/view/eba744a0-8e39-11eb-966b-2361593353f9?_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-1w%2Cto%3Anow))