Issues API endpoint performs poorly
Zendesk issue: https://gitlab.zendesk.com/agent/tickets/25340
/issues endpoint performs really poorly. Customer notes that the performance got significantly worse in 8.8. I looked through code and see a couple of suspect things: We now check if a user is subscribed to an issue and return the boolean, and we also count user notes on an issue. I'm not sure if these are the root causes of the slowness, though.
In my testing, the following query took 12-13 seconds on GitLab.com. Several times this query failed (404), too. Customer reports that in extreme cases it takes minutes to return.
curl -H "PRIVATE-TOKEN: my_token" "https://gitlab.com/api/v3/issues?per_page=100&page=1"
The relevant code is in
lib/api/entities.rb and various model classes such as
@yorickpeterse or @joshfng do you mind checking in to this, please?