Backend: Add cached denormalized count of jobs - GraphQL
Problem
The example query below blows up with an Internal Server Error
.
This is due to the count field on the CiJobConnection type. That field works fine for projects with low job records but when they are larger the query blows up with an Internal server error.
This prevents rollout of the new jobs table filtered search. [jobs_table_vue] Rollout Plan (#327500 - closed)
{
project(fullPath: "gitlab-org/gitlab") {
jobs {
count
}
}
}
Potential Solution
Suggestion from @alexkalderimis in the #f_graphql
channel for a solution.
We probably need a cached denormalized count of jobs (like we have for some other records), if throwing indices at the problem does not solve things. For example we do this with the open MR count on projects
Or add a limited count field: #360672 (comment 941308255)
Edited by Marius Bobin