explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9wAF

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 4.359 57.752 ↓ 1.1 3,165 1

Nested Loop Left Join (cost=1.87..28,940.13 rows=2,929 width=753) (actual time=0.076..57.752 rows=3,165 loops=1)

  • Filter: ((project_features.merge_requests_access_level > 0) OR (project_features.merge_requests_access_level IS NULL))
  • Rows Removed by Filter: 12
  • Buffers: shared hit=56,872
2. 2.928 47.039 ↓ 1.1 3,177 1

Nested Loop (cost=1.44..27,497.28 rows=2,963 width=757) (actual time=0.067..47.039 rows=3,177 loops=1)

  • Buffers: shared hit=44,162
3. 2.398 25.049 ↓ 1.0 3,177 1

Nested Loop (cost=1.00..14,691.69 rows=3,151 width=753) (actual time=0.031..25.049 rows=3,177 loops=1)

  • Buffers: shared hit=18,656
4. 3.589 3.589 ↓ 1.0 3,177 1

Index Scan using index_merge_request_assignees_on_user_id on public.merge_request_assignees (cost=0.44..3,437.74 rows=3,151 width=4) (actual time=0.018..3.589 rows=3,177 loops=1)

  • Index Cond: (merge_request_assignees.user_id = 1)
  • Buffers: shared hit=2,763
5. 19.062 19.062 ↑ 1.0 1 3,177

Index Scan using merge_requests_pkey on public.merge_requests (cost=0.56..3.57 rows=1 width=753) (actual time=0.006..0.006 rows=1 loops=3,177)

  • Index Cond: (merge_requests.id = merge_request_assignees.merge_request_id)
  • Buffers: shared hit=15,893
6. 9.531 19.062 ↑ 1.0 1 3,177

Index Scan using projects_pkey on public.projects (cost=0.43..4.06 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=3,177)

  • Index Cond: (projects.id = merge_requests.target_project_id)
  • Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (projects.visibility_level = ANY ('{0,10,20}'::integer[])))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=25,506
7.          

SubPlan (for Index Scan)

8. 9.531 9.531 ↑ 1.0 1 3,177

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations (cost=0.57..3.59 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=3,177)

  • Index Cond: ((project_authorizations.user_id = 1) AND (project_authorizations.project_id = projects.id))
  • Heap Fetches: 25
  • Buffers: shared hit=12,796
9. 0.000 0.000 ↓ 0.0 0 0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on public.project_authorizations project_authorizations_1 (cost=0.57..947.07 rows=2,735 width=4) (actual time=0.000..0.000 rows=0 loops=0)

  • Index Cond: (project_authorizations_1.user_id = 1)
  • Heap Fetches: 0
10. 6.354 6.354 ↑ 1.0 1 3,177

Index Scan using index_project_features_on_project_id on public.project_features (cost=0.43..0.47 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=3,177)

  • Index Cond: (projects.id = project_features.project_id)
  • Buffers: shared hit=12,710