Apply `skip_default_order: true` to the `group/{id}/audit_events` API endpoint
Description
In the issue API endpoint to retrieve all audit events under a given group, we added a query to return all of the project audit events under a group in addition to the group-level audit events.
We then also added without_count: true
in #414578 (closed) to get rid of a problematic COUNT
wrapping the query
the good news, the COUNT
is gone.
the bad news, still timing out on bigger groups
- works: https://gitlab.com/api/v4/groups/5753100/audit_events
- doesnt work: https://gitlab.com/api/v4/groups/785414/audit_events
from the logs, it appears something is adding an id
ordering at the end of the query
SELECT (records).* FROM "recursive_keyset_cte" AS "audit_events" WHERE (count <> $1)) audit_events ORDER BY "id" DESC LIMIT $26 OFFSET $25
The original query should already be ordered by created_at
SELECT (records).* FROM "recursive_keyset_cte" AS "audit_events" WHERE (count <> 0)) audit_events LIMIT 10
Proposed Solution
We want to experiment with passing the skip_default_order
to the paginate query behind our FF
Edited by Michael Becker