explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ouox

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Sort (cost=507,983,741.06..508,096,798.00 rows=45,222,776 width=756) (actual rows= loops=)

  • Sort Key: merge_requests.id DESC
2. 0.000 0.000 ↓ 0.0

Merge Right Join (cost=6,981.03..473,019,804.84 rows=45,222,776 width=756) (actual rows= loops=)

  • Merge Cond: (project_features.project_id = projects.id)
  • Filter: ((project_features.merge_requests_access_level > 0) OR (project_features.merge_requests_access_level IS NULL))
3. 0.000 0.000 ↓ 0.0

Index Scan using index_project_features_on_project_id on project_features (cost=0.43..719,835.37 rows=15,482,801 width=8) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Materialize (cost=6,980.59..471,573,604.77 rows=45,843,846 width=760) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Merge Join (cost=6,980.59..471,458,995.16 rows=45,843,846 width=760) (actual rows= loops=)

  • Merge Cond: (merge_requests.target_project_id = projects.id)
6. 0.000 0.000 ↓ 0.0

Index Scan using index_merge_requests_on_target_project_id_and_iid on merge_requests (cost=0.56..413,941,965.47 rows=45,843,846 width=756) (actual rows= loops=)

  • Filter: ((alternatives: SubPlan 3 or hashed SubPlan 4) OR (alternatives: SubPlan 5 or hashed SubPlan 6))
7.          

SubPlan (for Index Scan)

8. 0.000 0.000 ↓ 0.0

Index Only Scan using index_merge_request_assignees_on_merge_request_id_and_user_id on merge_request_assignees (cost=0.44..3.46 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((merge_request_id = merge_requests.id) AND (user_id = 4,901,936))
9. 0.000 0.000 ↓ 0.0

Index Scan using index_merge_request_assignees_on_user_id on merge_request_assignees merge_request_assignees_1 (cost=0.44..153.40 rows=138 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 4,901,936)
10. 0.000 0.000 ↓ 0.0

Index Only Scan using index_merge_request_reviewers_on_merge_request_id_and_user_id on merge_request_reviewers (cost=0.15..3.17 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((merge_request_id = merge_requests.id) AND (user_id = 4,901,936))
11. 0.000 0.000 ↓ 0.0

Index Scan using index_merge_request_reviewers_on_user_id on merge_request_reviewers merge_request_reviewers_1 (cost=0.15..10.78 rows=7 width=8) (actual rows= loops=)

  • Index Cond: (user_id = 4,901,936)
12. 0.000 0.000 ↓ 0.0

Index Scan using projects_pkey on projects (cost=0.43..56,913,715.38 rows=15,438,401 width=4) (actual rows= loops=)

  • Filter: ((alternatives: SubPlan 1 or hashed SubPlan 2) OR (visibility_level = ANY ('{0,10,20}'::integer[])))
13.          

SubPlan (for Index Scan)

14. 0.000 0.000 ↓ 0.0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations (cost=0.57..3.59 rows=1 width=0) (actual rows= loops=)

  • Index Cond: ((user_id = 4,901,936) AND (project_id = projects.id))
15. 0.000 0.000 ↓ 0.0

Index Only Scan using index_project_authorizations_on_user_id_project_id_access_level on project_authorizations project_authorizations_1 (cost=0.57..1,020.29 rows=2,678 width=4) (actual rows= loops=)

  • Index Cond: (user_id = 4,901,936)