Improve some queries in project list MRs API endpoint
What does this MR do and why?
Adding + 0 helps postgres not to use a non-efficient query plan.
Here are some before and after tests:
Projects API queries
- next page query
- count query
Projects GraphQL query
- BEFORE: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/41319/commands/127093
- AFTER: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/41319/commands/127094
- No noticeable difference
Disclaimer: The postgres.ai execution times (the BEFORE) seem to be way slower than production. I don't see these queries taking this long on production when I profiled the endpoints.
References
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #552376 (closed)
Edited by Patrick Bajao