-
🔴 @smcgivernContributorQUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------- Aggregate (cost=149538.20..149538.21 rows=1 width=8) (actual time=17361.842..17361.843 rows=1 loops=1) -> Limit (cost=6285.39..149413.19 rows=10001 width=4) (actual time=370.277..17355.557 rows=10001 loops=1) -> Nested Loop (cost=6285.39..4923893.64 rows=343616 width=4) (actual time=370.275..17348.765 rows=10001 loops=1) -> Nested Loop (cost=6284.96..3456461.25 rows=370447 width=8) (actual time=370.248..17232.484 rows=12038 loops=1) -> Bitmap Heap Scan on issues (cost=6284.53..603569.68 rows=666311 width=4) (actual time=370.165..15742.500 rows=146551 loops=1) Recheck Cond: (((title)::text ~~* '%test%'::text) OR (description ~~* '%test%'::text)) Rows Removed by Index Recheck: 1012548 Filter: ((deleted_at IS NULL) AND (confidential IS NOT TRUE)) Rows Removed by Filter: 7710 Heap Blocks: exact=37445 lossy=78756 -> BitmapOr (cost=6284.53..6284.53 rows=695917 width=0) (actual time=333.459..333.459 rows=0 loops=1) -> Bitmap Index Scan on index_issues_on_title_trigram (cost=0.00..1598.30 rows=190906 width=0) (actual time=80.307..80.307 rows=178661 loops=1) Index Cond: ((title)::text ~~* '%test%'::text) -> Bitmap Index Scan on index_issues_on_description_trigram (cost=0.00..4353.08 rows=505011 width=0) (actual time=253.147..253.147 rows=481439 loo ps=1) Index Cond: (description ~~* '%test%'::text) -> Index Scan using projects_pkey on projects (cost=0.43..4.27 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=146551) Index Cond: (id = issues.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) (a ctual time=0.002..0.002 rows=0 loops=146551) Index Cond: ((user_id = 443319) AND (project_id = projects.id)) Heap Fetches: 330 SubPlan 2 -> Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.43 ..10.23 rows=89 width=4) (never executed) Index Cond: (user_id = 443319) Heap Fetches: 0 -> Index Scan using index_project_features_on_project_id on project_features (cost=0.43..3.95 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=12038) 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=1602) Index Cond: ((user_id = 443319) AND (project_id = projects.id)) Heap Fetches: 1 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: 2.743 ms Execution time: 17362.058 ms (41 rows)
Please register or sign in to comment