Admin::RunnersController#show does slow CI job selection
The Admin view on Runner show page selects the last 30 builds to show. This runs the follow query:
SELECT ci_builds.* FROM CI_builds WHERE ci_builds.type IN ('Ci:Build') AND ci-Builds.runner-id = $1 ORDER BY id DESC LIMIT 30
The problematic part is the order by, followed by the limit. Which means it has to fetch all the builds into memory, and than sort them. If the runner has had tens of thousands of jobs to order, it has to iterate on all of them.
/cc @steveazz @jlenny