Skip to content

Add metrics for user merge request with assigned security policy project

What does this MR do and why?

This MR adds metrics to count total users creating MRs in projects with assigned Security Policy Project.

Queries

explain SELECT COUNT(DISTINCT "merge_requests"."author_id") FROM "merge_requests"
INNER JOIN security_orchestration_policy_configurations ON merge_requests.target_project_id = security_orchestration_policy_configurations.project_id 
WHERE "merge_requests"."author_id" BETWEEN 5525431 AND 5535431;

Before index

Time: 3.815 min  
  - planning: 5.356 ms  
  - execution: 3.814 min  
    - I/O read: 3.767 min  
    - I/O write: 0.000 ms  

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/12552/commands/44303

After index

Time: 2.998 s  
  - planning: 1.188 ms  
  - execution: 2.997 s  
    - I/O read: 2.884 s  
    - I/O write: 0.000 ms  

https://postgres.ai/console/gitlab/gitlab-production-tunnel-pg12/sessions/12552/commands/44339

MR acceptance checklist

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

Related to #375284 (closed)

Edited by Alan (Maciej) Paruszewski

Merge request reports

Loading