Optimise Notes::CopyService SQL queries
Problem
Notes::CopyService does not perform well when called from Issues::MoveService and DesignManagement::CopyDesignCollection::CopyService.
See !41714 (comment 419395864) for a description of the problem.
Proposal
Looks for ways to reduce the number of SQL queries.
Also see this comment from @alexkalderimis: !44662 (comment 426534106) as something to perhaps explore.
Backlog Refinement Notes
the aim is to improve performance rather than eliminate all problems (Notes::CopyService has been in the wild for a while now, refactored from code that was essentially the same, so any issues are not new) and we could focus on the low-hanging fruit.
If we discover more complicated problems (that are important to address) we could generate issues for them.
Looking at the queries in !41714 (comment 419395864) it does seem like some of it is N+1 queries, so I agree with Luke to focus on that in this issue.