Optimise standards adherence dashboard loading
What does this MR do and why?
- Use
InOperatorOptimization
module on standards adherence dashboard. - No user facing change (UX/UI), all the existing tests (unit, feature, etc.) still pass.
- 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.
- Ensure that you have ultimate license on your GDK.
- Enable feature flags
adherence_report_ui
andcompliance_adherence_report
- Visit the compliance center from the group's homepage (Secure > Compliance center). Eg
https://gitlab.com/groups/issue-reproduce/-/security/compliance_dashboard/standards_adherence
- Ensure that the records are displayed.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Closes #419025 (closed)
Edited by Huzaifa Iftikhar