explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gtfq

Settings
# exclusive inclusive rows x rows loops node
1. 4.842 164.265 ↓ 187.1 36,297 1

Nested Loop (cost=2,336.39..2,478.84 rows=194 width=168) (actual time=0.237..164.265 rows=36,297 loops=1)

  • Buffers: shared hit=180126
2. 8.763 50.532 ↓ 185.2 36,297 1

Nested Loop (cost=2,335.95..2,374.84 rows=196 width=168) (actual time=0.228..50.532 rows=36,297 loops=1)

  • Buffers: shared hit=34628
3. 0.153 0.322 ↓ 3.7 191 1

HashAggregate (cost=2,335.39..2,335.90 rows=51 width=4) (actual time=0.218..0.322 rows=191 loops=1)

  • Group Key: projects.id
  • Buffers: shared hit=196
4. 0.023 0.169 ↓ 3.7 191 1

Nested Loop (cost=1,678.31..2,335.26 rows=51 width=4) (actual time=0.050..0.169 rows=191 loops=1)

  • Buffers: shared hit=196
5. 0.001 0.043 ↑ 28.0 1 1

Nested Loop (cost=1,677.88..2,308.07 rows=28 width=8) (actual time=0.042..0.043 rows=1 loops=1)

  • Buffers: shared hit=12
6. 0.003 0.038 ↑ 141.0 1 1

HashAggregate (cost=1,677.45..1,678.86 rows=141 width=4) (actual time=0.038..0.038 rows=1 loops=1)

  • Group Key: namespaces_1.id
  • Buffers: shared hit=8
7. 0.035 0.035 ↑ 141.0 1 1

CTE Scan on base_and_descendants namespaces_1 (cost=1,672.86..1,675.68 rows=141 width=4) (actual time=0.024..0.035 rows=1 loops=1)

  • Buffers: shared hit=8
8.          

CTE base_and_descendants

9. 0.010 0.033 ↑ 141.0 1 1

Recursive Union (cost=0.43..1,672.86 rows=141 width=334) (actual time=0.021..0.033 rows=1 loops=1)

  • Buffers: shared hit=8
10. 0.013 0.013 ↑ 1.0 1 1

Index Scan using namespaces_pkey on public.namespaces namespaces_2 (cost=0.43..4.45 rows=1 width=334) (actual time=0.012..0.013 rows=1 loops=1)

  • Index Cond: (namespaces_2.id = 2735941)
  • Filter: ((namespaces_2.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4
11. 0.001 0.010 ↓ 0.0 0 1

Nested Loop (cost=0.56..166.56 rows=14 width=334) (actual time=0.010..0.010 rows=0 loops=1)

  • Buffers: shared hit=4
12. 0.001 0.001 ↑ 10.0 1 1

WorkTable Scan on base_and_descendants (cost=0.00..0.20 rows=10 width=4) (actual time=0.001..0.001 rows=1 loops=1)

13. 0.008 0.008 ↓ 0.0 0 1

Index Scan using index_namespaces_on_parent_id_and_id on public.namespaces namespaces_3 (cost=0.56..16.63 rows=1 width=334) (actual time=0.008..0.008 rows=0 loops=1)

  • Index Cond: (namespaces_3.parent_id = base_and_descendants.id)
  • Filter: ((namespaces_3.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4
14. 0.004 0.004 ↑ 1.0 1 1

Index Scan using namespaces_pkey on public.namespaces (cost=0.43..4.45 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (namespaces.id = namespaces_1.id)
  • Filter: ((namespaces.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4
15. 0.103 0.103 ↓ 11.2 191 1

Index Only Scan using index_projects_on_namespace_id_and_id on public.projects (cost=0.43..0.80 rows=17 width=8) (actual time=0.007..0.103 rows=191 loops=1)

  • Index Cond: (projects.namespace_id = namespaces.id)
  • Heap Fetches: 8
  • Buffers: shared hit=184
16. 41.447 41.447 ↓ 47.5 190 191

Index Scan using index_members_on_source_id_and_source_type on public.members (cost=0.56..0.72 rows=4 width=168) (actual time=0.015..0.217 rows=190 loops=191)

  • Index Cond: ((members.source_id = projects.id) AND ((members.source_type)::text = 'Project'::text))
  • Filter: ((members.requested_at IS NULL) AND ((members.type)::text = 'ProjectMember'::text))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=34432
17. 108.891 108.891 ↑ 1.0 1 36,297

Index Scan using users_pkey on public.users (cost=0.43..0.52 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=36,297)

  • Index Cond: (users.id = members.user_id)
  • Filter: (((users.user_type IS NULL) OR (users.user_type <> 6)) AND ((users.state)::text = 'active'::text))
  • Rows Removed by Filter: 0
  • Buffers: shared hit=145498