explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5ChZ

Settings
# exclusive inclusive rows x rows loops node
1. 0.073 6.776 ↓ 1.6 500 1

Limit (cost=1,259.32..9,230.20 rows=315 width=16) (actual time=0.134..6.776 rows=500 loops=1)

2. 0.717 6.703 ↓ 1.6 500 1

Nested Loop (cost=1,259.32..9,230.20 rows=315 width=16) (actual time=0.134..6.703 rows=500 loops=1)

3. 0.084 2.092 ↑ 1.6 649 1

Nested Loop (cost=1,258.76..8,573.13 rows=1,061 width=12) (actual time=0.097..2.092 rows=649 loops=1)

4. 0.000 0.063 ↑ 2,101.0 1 1

Nested Loop (cost=1,258.20..4,614.22 rows=2,101 width=4) (actual time=0.063..0.063 rows=1 loops=1)

5. 0.039 0.039 ↑ 131.0 1 1

CTE Scan on base_and_descendants namespaces (cost=1,257.76..1,260.38 rows=131 width=2,907) (actual time=0.039..0.039 rows=1 loops=1)

6.          

CTE base_and_descendants

7. 0.015 0.035 ↑ 131.0 1 1

Recursive Union (cost=0.43..1,257.76 rows=131 width=322) (actual time=0.035..0.035 rows=1 loops=1)

8. 0.020 0.020 ↑ 1.0 1 1

Index Scan using namespaces_pkey on namespaces namespaces_1 (cost=0.43..3.45 rows=1 width=322) (actual time=0.020..0.020 rows=1 loops=1)

  • Index Cond: (id = 9970)
  • Filter: ((type)::text = 'Group'::text)
9. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.43..125.17 rows=13 width=322) (never executed)

10. 0.000 0.000 ↓ 0.0 0

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (never executed)

11. 0.000 0.000 ↓ 0.0 0

Index Scan using index_namespaces_on_parent_id_and_id on namespaces namespaces_2 (cost=0.43..12.49 rows=1 width=322) (never executed)

  • Index Cond: (parent_id = base_and_descendants.id)
  • Filter: ((type)::text = 'Group'::text)
12. 0.024 0.024 ↑ 16.0 1 1

Index Scan using index_projects_on_namespace_id on projects (cost=0.43..25.43 rows=16 width=8) (actual time=0.023..0.024 rows=1 loops=1)

  • Index Cond: (namespace_id = namespaces.id)
13. 1.945 1.945 ↓ 20.3 649 1

Index Scan using index_merge_requests_target_project_id_created_at on merge_requests (cost=0.56..1.56 rows=32 width=16) (actual time=0.033..1.945 rows=649 loops=1)

  • Index Cond: ((target_project_id = projects.id) AND (created_at >= '2019-07-01 00:00:00+00'::timestamp with time zone) AND (created_at <= '2019-11-01 00:00:00+00'::timestamp with time zone))
14. 3.894 3.894 ↑ 1.0 1 649

Index Only Scan using index_merge_request_metrics_on_merge_request_id_and_merged_at on merge_request_metrics (cost=0.56..0.61 rows=1 width=12) (actual time=0.006..0.006 rows=1 loops=649)

  • Index Cond: ((merge_request_id = merge_requests.id) AND (merged_at >= merge_requests.created_at))
  • Heap Fetches: 13
Planning time : 2.709 ms
Execution time : 7.077 ms