Skip to content
  • Contributor
                                                                                                                        QUERY PLAN
    
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -------------------------------------------------------------
     Aggregate  (cost=457487.12..457487.13 rows=1 width=8) (actual time=6396.866..6396.866 rows=1 loops=1)
       ->  Limit  (cost=170942.99..457470.06 rows=1365 width=4) (actual time=4698.364..6393.063 rows=10001 loops=1)
             ->  Nested Loop  (cost=170942.99..457470.06 rows=1365 width=4) (actual time=4698.363..6387.996 rows=10001 loops=1)
                   ->  Nested Loop  (cost=170942.56..451631.10 rows=1474 width=12) (actual time=4698.324..6328.213 rows=11071 loops=1)
                         ->  Nested Loop  (cost=170942.13..359774.23 rows=16826 width=8) (actual time=4698.094..5632.127 rows=7890 loops=1)
                               ->  HashAggregate  (cost=170941.70..171245.03 rows=30333 width=4) (actual time=4697.964..4775.871 rows=97645 loops=1)
                                     Group Key: merge_requests_1.target_project_id
                                     ->  Index Only Scan using index_merge_requests_on_target_project_id_and_iid on merge_requests merge_requests_1  (cost=0.43..155541.95 rows=6159899 w
    idth=4) (actual time=0.032..2465.083 rows=5642719 loops=1)
                                           Heap Fetches: 29383
                               ->  Index Scan using projects_pkey on projects  (cost=0.43..6.21 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=97645)
                                     Index Cond: (id = merge_requests_1.target_project_id)
                                     Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (visibility_level = ANY ('{10,20}'::integer[])))
                                     Rows Removed by Filter: 1
                                     SubPlan 1
                                       ->  Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations  (cost=0.43..3.45 rows=1 width
    =0) (actual time=0.002..0.002 rows=0 loops=97645)
                                             Index Cond: ((user_id = 49) AND (project_id = projects.id))
                                             Heap Fetches: 0
                                     SubPlan 2
                                       ->  Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1  (cos
    t=0.43..6.29 rows=88 width=4) (never executed)
                                             Index Cond: (user_id = 49)
                                             Heap Fetches: 0
                         ->  Index Scan using index_merge_requests_on_target_project_id_and_iid on merge_requests  (cost=0.43..5.35 rows=11 width=4) (actual time=0.031..0.087 rows=1 loo
    ps=7890)
                               Index Cond: (target_project_id = projects.id)
                               Filter: (((title)::text ~~* '%test%'::text) OR (description ~~* '%test%'::text))
                               Rows Removed by Filter: 9
                   ->  Index Scan using index_project_features_on_project_id on project_features  (cost=0.43..3.95 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=11071)
                         Index Cond: (project_id = projects.id)
                         Filter: ((merge_requests_access_level = ANY ('{NULL,20}'::integer[])) OR ((merge_requests_access_level = 10) AND (alternatives: SubPlan 3 or hashed SubPlan 4)))
                         Rows Removed by Filter: 0
                         SubPlan 3
                           ->  Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_2  (cost=0.43..3.45
     rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=809)
                                 Index Cond: ((user_id = 49) AND (project_id = projects.id))
                                 Heap Fetches: 0
                         SubPlan 4
                           ->  Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_3  (cost=0.43..6.29
     rows=88 width=4) (never executed)
                                 Index Cond: (user_id = 49)
                                 Heap Fetches: 0
     Planning time: 2.573 ms
     Execution time: 6397.063 ms
    (39 rows)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment