Skip to content

Apply `:skip_default_order` to the `group/{id}/audit_events` API

What does this MR do and why?

In this commit, We want to experiment with passing the skip_default_order to the paginate query behind our FF

background context

In issue 337757, 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 issue 414578 to get rid of a problematic COUNT wrapping the query

the good news, the COUNT is gone.

the bad news, still timing out requests on larger groups

eg:

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
  • Changelog: changed
  • EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415163 (closed)

Edited by Michael Becker

Merge request reports

Loading