• Contributor
                                                                                                                        QUERY PLAN
    
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    -------------------------------------------------------------
     Aggregate  (cost=1458911.26..1458911.27 rows=1 width=8) (actual time=11844.241..11844.241 rows=1 loops=1)
       ->  Limit  (cost=1090829.39..1458868.56 rows=3416 width=4) (actual time=9029.351..11839.998 rows=10001 loops=1)
             ->  Nested Loop  (cost=1090829.39..1458868.56 rows=3416 width=4) (actual time=9029.349..11834.554 rows=10001 loops=1)
                   ->  Nested Loop  (cost=1090828.96..1444314.75 rows=3674 width=12) (actual time=9029.304..11757.331 rows=11059 loops=1)
                         ->  Nested Loop  (cost=1090828.52..1315538.47 rows=20406 width=8) (actual time=9029.225..9891.036 rows=6715 loops=1)
                               ->  HashAggregate  (cost=1090828.09..1091194.65 rows=36655 width=4) (actual time=9029.106..9089.662 rows=68784 loops=1)
                                     Group Key: issues_1.project_id
                                     ->  Seq Scan on issues issues_1  (cost=0.00..1071197.55 rows=7852218 width=4) (actual time=0.026..5643.316 rows=5941948 loops=1)
                                           Filter: ((deleted_at IS NULL) AND (confidential IS NOT TRUE))
                                           Rows Removed by Filter: 153544
                               ->  Index Scan using projects_pkey on projects  (cost=0.43..6.11 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=68784)
                                     Index Cond: (id = issues_1.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=68784)
                                             Index Cond: ((user_id = 443319) AND (project_id = projects.id))
                                             Heap Fetches: 2
                                     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..10.23 rows=89 width=4) (never executed)
                                             Index Cond: (user_id = 443319)
                                             Heap Fetches: 0
                         ->  Index Scan using index_issues_on_project_id_and_iid on issues  (cost=0.43..6.13 rows=18 width=4) (actual time=0.086..0.276 rows=2 loops=6715)
                               Index Cond: (project_id = projects.id)
                               Filter: ((deleted_at IS NULL) AND (confidential IS NOT TRUE) AND (((title)::text ~~* '%test%'::text) OR (description ~~* '%test%'::text)))
                               Rows Removed by Filter: 14
                   ->  Index Scan using index_project_features_on_project_id on project_features  (cost=0.43..3.95 rows=1 width=8) (actual time=0.005..0.006 rows=1 loops=11059)
                         Index Cond: (project_id = projects.id)
                         Filter: ((issues_access_level = ANY ('{NULL,20}'::integer[])) OR ((issues_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=727)
                                 Index Cond: ((user_id = 443319) 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..10.2
    3 rows=89 width=4) (never executed)
                                 Index Cond: (user_id = 443319)
                                 Heap Fetches: 0
     Planning time: 8.682 ms
     Execution time: 11846.694 ms
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment