Limit count query in the events APIs
What does this MR do and why?
This change limits the count query for events to 10,000. The query
provides the total count used for the X-Total
and X-Total-Pages
headers. When the offset exceeds 10,000, these headers are not
returned. This limitation improves query performance for large
datasets.
See the related discussion #357839 (comment 2119565466).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Query plans
- Before - https://console.postgres.ai/gitlab/gitlab-production-main/sessions/31705/commands/98222
- After - https://console.postgres.ai/gitlab/gitlab-production-main/sessions/31705/commands/98220
How to set up and validate locally
Go to https://gdk.test:3000/api/v4/projects/30/events.
Related to #357839
Edited by Abdul Wadood