Revert "Merge branch 'nrotaru/572794-fix-tool-coverage-counters-update' into 'master'"
What does this MR do and why?
This MR reverts merge request !208741 (merged)
Reference
Performance Problem
The UNION ALL
implementation introduced significant performance degradation:
- Query complexity increased dramatically - The execution plan shows the query cost jumped from ~661K to ~2.3M cost units
- Query timeouts occurred - The complex UNION ALL with multiple table scans and anti-joins caused queries to exceed timeout limits
- Production impact - The performance issues affected the live GitLab.com environment
Technical Details
The problematic UNION ALL
clause added:
- A
CROSS JOIN
betweennamespace_data
andanalyzer_namespace_statuses
- An expensive
NOT EXISTS
subquery with complex traversal ID filtering - Additional sorting and uniqueness operations that significantly increased execution time
Changes Reverted
The revert removes:
-
SQL Query Changes: The entire
UNION ALL
clause fromAdjustmentService
- Test Coverage: All related test cases that validated the archived projects scenario
Impact
- Immediate: Restores query performance to acceptable levels
- Trade-off: Reintroduces the original bug where Tool Coverage stats aren't reset to zero when all projects are archived
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.
Edited by Nicolae Rotaru