-
🔴 @smcgivernQUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------- Aggregate (cost=6997.22..6997.23 rows=1 width=8) (actual time=64.161..64.162 rows=1 loops=1) -> Nested Loop (cost=244.56..6997.21 rows=3 width=0) (actual time=26.280..64.132 rows=54 loops=1) -> Nested Loop Semi Join (cost=244.13..6985.34 rows=3 width=12) (actual time=26.248..62.983 rows=62 loops=1) -> Nested Loop (cost=243.70..6788.65 rows=435 width=8) (actual time=26.213..62.008 rows=62 loops=1) -> Bitmap Heap Scan on merge_requests (cost=243.27..1414.45 rows=780 width=4) (actual time=25.276..55.491 rows=709 loops=1) Recheck Cond: (((title)::text ~~* '%test1%'::text) OR (description ~~* '%test1%'::text)) Rows Removed by Index Recheck: 93 Filter: (deleted_at IS NULL) Rows Removed by Filter: 13 Heap Blocks: exact=790 -> BitmapOr (cost=243.27..243.27 rows=784 width=0) (actual time=24.945..24.945 rows=0 loops=1) -> Bitmap Index Scan on index_merge_requests_on_title_trigram (cost=0.00..87.93 rows=524 width=0) (actual time=7.082..7.082 rows=534 loops=1) Index Cond: ((title)::text ~~* '%test1%'::text) -> Bitmap Index Scan on index_merge_requests_on_description_trigram (cost=0.00..154.95 rows=260 width=0) (actual time=17.860..17.860 rows=298 loop s=1) Index Cond: (description ~~* '%test1%'::text) -> Index Scan using projects_pkey on projects (cost=0.43..6.88 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=709) Index Cond: (id = merge_requests.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) (a ctual time=0.002..0.002 rows=0 loops=709) Index Cond: ((user_id = 1642716) 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 (cost=0.43 ..10.19 rows=84 width=4) (never executed) Index Cond: (user_id = 1642716) Heap Fetches: 0 -> Index Scan using index_merge_requests_on_target_project_id_and_iid on merge_requests merge_requests_1 (cost=0.43..4.12 rows=190 width=4) (actual time=0.014..0.01 4 rows=1 loops=62) Index Cond: (target_project_id = projects.id) Filter: (deleted_at IS NULL) -> Index Scan using index_project_features_on_project_id on project_features (cost=0.43..3.95 rows=1 width=8) (actual time=0.017..0.017 rows=1 loops=62) 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=8) Index Cond: ((user_id = 1642716) 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.19 rows =84 width=4) (never executed) Index Cond: (user_id = 1642716) Heap Fetches: 0 Planning time: 4.041 ms Execution time: 64.442 ms
:notbad:
Please register or sign in to comment