Skip to content

Optimise standards adherence dashboard loading

What does this MR do and why?

  1. Use InOperatorOptimization module on standards adherence dashboard.
  2. No user facing change (UX/UI), all the existing tests (unit, feature, etc.) still pass.
  3. The existing query to fetch a single adherence record, while creating or updating standards adherence is already optimised, so we have kept it as it is. Link to DB Lab.

Database

Index creation

i_compliance_standards_adherence_on_namespace_id_and_proj_id takes 10.027s.

Comparison of old and new database query

Filter DB lab old query DB lab new query Old query time New query time Improvement in time Old query buffers hit New query buffers hit Improvement in shared buffers hit
None (default) 74820 75143 23.169 s 159.135 ms 99.31% ~2.50 GiB ~11 MiB 99.57%
filter by standard 75210 75206 461.150 ms 13.374 ms 97.10% ~2.90 GiB ~6.60 MiB 99.78%
filter by project_ids 75208 75203 41.399 ms 11.708 ms 71.72% ~100 KiB ~4.40 MiB NA
filter by check_name 75211 75205 17.367 s 12.989 ms 99.92% ~13.66 GiB ~7.70 MiB 99.94%

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.

  1. Ensure that you have ultimate license on your GDK.
  2. Enable feature flags adherence_report_ui and compliance_adherence_report
  3. Visit the compliance center from the group's homepage (Secure > Compliance center). Eg https://gitlab.com/groups/issue-reproduce/-/security/compliance_dashboard/standards_adherence
  4. Ensure that the records are displayed.
  5. Filtering via the UI is not possible yet so use GraphQL to add the filters. The available filters are defined in this doc. Eg: See query in this comment.

MR acceptance checklist

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

Closes #419025 (closed)

Edited by Huzaifa Iftikhar

Merge request reports