explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Uptr

Settings
# exclusive inclusive rows x rows loops node
1. 0.517 20.054 ↓ 5.2 1,014 1

Nested Loop (cost=1,795.87..1,933.61 rows=196 width=168) (actual time=4.955..20.054 rows=1,014 loops=1)

2. 0.145 13.423 ↓ 5.1 1,019 1

Nested Loop (cost=1,795.44..1,833.72 rows=198 width=168) (actual time=4.937..13.423 rows=1,019 loops=1)

3. 0.503 5.079 ↓ 17.9 911 1

HashAggregate (cost=1,794.88..1,795.39 rows=51 width=4) (actual time=4.894..5.079 rows=911 loops=1)

  • Group Key: projects.id
4. 0.113 4.576 ↓ 17.9 911 1

Nested Loop (cost=1,280.13..1,794.75 rows=51 width=4) (actual time=1.361..4.576 rows=911 loops=1)

5. 0.041 2.131 ↓ 3.8 106 1

Nested Loop (cost=1,279.69..1,767.47 rows=28 width=8) (actual time=1.342..2.131 rows=106 loops=1)

6. 0.052 1.348 ↑ 1.3 106 1

HashAggregate (cost=1,279.26..1,280.67 rows=141 width=4) (actual time=1.325..1.348 rows=106 loops=1)

  • Group Key: namespaces_1.id
7. 1.296 1.296 ↑ 1.3 106 1

CTE Scan on base_and_descendants namespaces_1 (cost=1,274.68..1,277.50 rows=141 width=4) (actual time=0.025..1.296 rows=106 loops=1)

8.          

CTE base_and_descendants

9. 0.226 1.161 ↑ 1.3 106 1

Recursive Union (cost=0.43..1,274.68 rows=141 width=334) (actual time=0.020..1.161 rows=106 loops=1)

10. 0.015 0.015 ↑ 1.0 1 1

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

  • Index Cond: (id = 9970)
  • Filter: ((type)::text = 'Group'::text)
11. 0.062 0.920 ↓ 1.5 21 5

Nested Loop (cost=0.56..126.84 rows=14 width=334) (actual time=0.016..0.184 rows=21 loops=5)

12. 0.010 0.010 ↓ 2.1 21 5

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

13. 0.848 0.848 ↑ 1.0 1 106

Index Scan using index_namespaces_on_parent_id_and_id on namespaces namespaces_3 (cost=0.56..12.65 rows=1 width=334) (actual time=0.005..0.008 rows=1 loops=106)

  • Index Cond: (parent_id = base_and_descendants.id)
  • Filter: ((type)::text = 'Group'::text)
14. 0.742 0.742 ↑ 1.0 1 106

Index Scan using namespaces_pkey on namespaces (cost=0.43..3.45 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=106)

  • Index Cond: (id = namespaces_1.id)
  • Filter: ((type)::text = 'Group'::text)
15. 2.332 2.332 ↑ 1.9 9 106

Index Only Scan using index_projects_on_namespace_id_and_id on projects (cost=0.43..0.80 rows=17 width=8) (actual time=0.007..0.022 rows=9 loops=106)

  • Index Cond: (namespace_id = namespaces.id)
  • Heap Fetches: 207
16. 8.199 8.199 ↑ 4.0 1 911

Index Scan using index_members_on_source_id_and_source_type on members (cost=0.56..0.71 rows=4 width=168) (actual time=0.007..0.009 rows=1 loops=911)

  • Index Cond: ((source_id = projects.id) AND ((source_type)::text = 'Project'::text))
  • Filter: ((requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text))
  • Rows Removed by Filter: 0
17. 6.114 6.114 ↑ 1.0 1 1,019

Index Scan using users_pkey on users (cost=0.43..0.50 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=1,019)

  • Index Cond: (id = members.user_id)
  • Filter: (((user_type IS NULL) OR (user_type <> 6)) AND ((state)::text = 'active'::text))
  • Rows Removed by Filter: 0
Planning time : 4.455 ms
Execution time : 20.326 ms