Use created_at in audit event queries
What does this MR do and why?
Use created_at in audit event queries
Optimise audit events api by ordering on created_at to avoid full partition scan
EE: true Changelog: added
References
- Query without created_at order by: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/44532/commands/136773
- Query with created_at order by: https://console.postgres.ai/gitlab/gitlab-production-main/sessions/44617/commands/136878
How to set up and validate locally
- Test audit event APIs docs.gitlab.com/api/audit_events/
- Test audit event dashboards. on sidebar -> Secure -> Audit events, for both group and project.
- Test admin/audit_logs
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 #516895
Edited  by Harsimar Sandhu