Skip to content

Adding index for created at and id on compliance violation

What does this MR do and why?

This MR is one of the many MRs that are going to be in implementation of this POC MR !192606 (merged) as per the implementation plan in #542342 (closed).

What?

  1. Dropped existing index on namespace_id for table project_compliance_violations.
  2. Added new index on namespace_id, created_at and id for the same table.
  3. Added a scope for ordering compliance violations by created_at and id.

Why?

This index will be helpful while fetching all the compliance violations records for a specific namespace and its subgroups and ordering them by created_at and id.

How to set up and validate locally

For this rspecs are enough, whole functionality can be tested in subsequent MRs.

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 #542342 (closed)

Edited by Hitesh Raghuvanshi

Merge request reports

Loading