explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tU1T

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2.555 ↑ 1.0 1 1

Aggregate (cost=1,291.25..1,291.26 rows=1 width=8) (actual time=2.555..2.555 rows=1 loops=1)

2. 0.003 2.553 ↑ 5.3 3 1

Nested Loop (cost=1,278.37..1,291.21 rows=16 width=0) (actual time=0.799..2.553 rows=3 loops=1)

3. 0.000 2.545 ↑ 1.0 1 1

Unique (cost=1,277.93..1,287.33 rows=1 width=4) (actual time=0.795..2.545 rows=1 loops=1)

4.          

CTE base_and_descendants

5. 0.409 2.307 ↓ 1.7 228 1

Recursive Union (cost=1.43..1,277.23 rows=131 width=322) (actual time=0.174..2.307 rows=228 loops=1)

6. 0.006 0.316 ↓ 2.0 2 1

Nested Loop Semi Join (cost=1.43..21.06 rows=1 width=322) (actual time=0.166..0.316 rows=2 loops=1)

7. 0.005 0.261 ↓ 7.0 7 1

Nested Loop (cost=0.87..20.27 rows=1 width=326) (actual time=0.093..0.261 rows=7 loops=1)

8. 0.193 0.193 ↓ 7.0 7 1

Index Scan using index_members_on_user_id on members (cost=0.43..16.80 rows=1 width=4) (actual time=0.081..0.193 rows=7 loops=1)

  • Index Cond: (user_id = 2535118)
  • Filter: ((requested_at IS NULL) AND (access_level >= 30) AND ((type)::text = 'GroupMember'::text) AND ((source_type)::text = 'Namespace'::text))
  • Rows Removed by Filter: 58
9. 0.063 0.063 ↑ 1.0 1 7

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

  • Index Cond: (id = members.source_id)
  • Filter: ((type)::text = 'Group'::text)
10. 0.003 0.049 ↓ 0.0 0 7

Nested Loop (cost=0.56..0.68 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=7)

11. 0.042 0.042 ↓ 0.0 0 7

Index Scan using index_gitlab_subscriptions_on_namespace_id on gitlab_subscriptions (cost=0.43..0.51 rows=1 width=8) (actual time=0.006..0.006 rows=0 loops=7)

  • Index Cond: (namespace_id = namespaces_2.id)
12. 0.004 0.004 ↑ 1.0 1 2

Index Scan using plans_pkey on plans (cost=0.13..0.15 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=2)

  • Index Cond: (id = gitlab_subscriptions.hosted_plan_id)
  • Filter: ((name)::text = ANY ('{silver,gold}'::text[]))
13. 0.200 1.582 ↓ 2.5 32 7

Nested Loop (cost=0.43..125.35 rows=13 width=322) (actual time=0.024..0.226 rows=32 loops=7)

14. 0.014 0.014 ↓ 3.3 33 7

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.000..0.002 rows=33 loops=7)

15. 1.368 1.368 ↑ 1.0 1 228

Index Scan using index_namespaces_on_parent_id_and_id on namespaces namespaces_3 (cost=0.43..12.51 rows=1 width=322) (actual time=0.004..0.006 rows=1 loops=228)

  • Index Cond: (parent_id = base_and_descendants.id)
  • Filter: ((type)::text = 'Group'::text)
16. 0.001 2.545 ↓ 3.0 3 1

Nested Loop (cost=0.71..10.10 rows=1 width=4) (actual time=0.795..2.545 rows=3 loops=1)

17. 0.003 2.528 ↑ 1.0 1 1

Nested Loop (cost=0.27..6.25 rows=1 width=4) (actual time=0.780..2.528 rows=1 loops=1)

  • Join Filter: (namespaces.parent_id = namespaces_1.id)
18. 2.517 2.517 ↑ 1.0 1 1

CTE Scan on base_and_descendants namespaces (cost=0.00..2.95 rows=1 width=8) (actual time=0.769..2.517 rows=1 loops=1)

  • Filter: (id = 4752251)
  • Rows Removed by Filter: 227
19. 0.008 0.008 ↑ 1.0 1 1

Index Scan using index_namespaces_on_custom_project_templates_group_id_and_type on namespaces namespaces_1 (cost=0.27..3.29 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: ((custom_project_templates_group_id = 4752251) AND ((type)::text = 'Group'::text))
20. 0.016 0.016 ↑ 5.0 3 1

Index Only Scan using index_projects_on_namespace_id on projects projects_1 (cost=0.43..3.70 rows=15 width=4) (actual time=0.015..0.016 rows=3 loops=1)

  • Index Cond: (namespace_id = 4752251)
  • Heap Fetches: 0
21. 0.005 0.005 ↑ 5.3 3 1

Index Only Scan using index_projects_on_namespace_id on projects (cost=0.43..3.72 rows=16 width=4) (actual time=0.002..0.005 rows=3 loops=1)

  • Index Cond: (namespace_id = namespaces.id)
  • Heap Fetches: 0
Planning time : 2.191 ms
Execution time : 2.746 ms