explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tDYL

Settings
# exclusive inclusive rows x rows loops node
1. 30.371 625.177 ↓ 187.1 36,297 1

Nested Loop (cost=2,336.38..2,476.80 rows=194 width=168) (actual time=3.107..625.177 rows=36,297 loops=1)

  • Buffers: shared hit=154214 read=17851 dirtied=840
  • I/O Timings: read=411.630
2. 14.250 449.618 ↓ 185.2 36,297 1

Nested Loop (cost=2,335.95..2,372.80 rows=196 width=168) (actual time=2.921..449.618 rows=36,297 loops=1)

  • Buffers: shared hit=9237 read=17328 dirtied=834
  • I/O Timings: read=387.857
3. 0.242 2.753 ↓ 3.7 191 1

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

  • Group Key: projects.id
  • Buffers: shared hit=162 read=34 dirtied=5
  • I/O Timings: read=2.122
4. 0.045 2.511 ↓ 3.7 191 1

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

  • Buffers: shared hit=162 read=34 dirtied=5
  • I/O Timings: read=2.122
5. 0.003 0.777 ↑ 28.0 1 1

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

  • Buffers: shared hit=5 read=7
  • I/O Timings: read=0.676
6. 0.006 0.764 ↑ 141.0 1 1

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

  • Group Key: namespaces_1.id
  • Buffers: shared hit=1 read=7
  • I/O Timings: read=0.676
7. 0.758 0.758 ↑ 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.453..0.758 rows=1 loops=1)

  • Buffers: shared hit=1 read=7
  • I/O Timings: read=0.676
8.          

CTE base_and_descendants

9. 0.013 0.755 ↑ 141.0 1 1

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

  • Buffers: shared hit=1 read=7
  • I/O Timings: read=0.676
10. 0.439 0.439 ↑ 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.437..0.439 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=1 read=3
  • I/O Timings: read=0.404
11. 0.002 0.303 ↓ 0.0 0 1

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

  • Buffers: shared read=4
  • I/O Timings: read=0.272
12. 0.014 0.014 ↑ 10.0 1 1

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

13. 0.287 0.287 ↓ 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.287..0.287 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 read=4
  • I/O Timings: read=0.272
14. 0.010 0.010 ↑ 1.0 1 1

Index Scan using namespaces_pkey on public.namespaces (cost=0.43..4.45 rows=1 width=4) (actual time=0.009..0.010 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. 1.689 1.689 ↓ 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.243..1.689 rows=191 loops=1)

  • Index Cond: (projects.namespace_id = namespaces.id)
  • Heap Fetches: 8
  • Buffers: shared hit=157 read=27 dirtied=5
  • I/O Timings: read=1.446
16. 432.615 432.615 ↓ 47.5 190 191

Index Scan using index_non_requested_project_members_on_source_id_and_type on public.members (cost=0.56..0.68 rows=4 width=168) (actual time=0.093..2.265 rows=190 loops=191)

  • Index Cond: ((members.source_id = projects.id) AND ((members.source_type)::text = 'Project'::text))
  • Buffers: shared hit=9075 read=17294 dirtied=829
  • I/O Timings: read=385.735
17. 145.188 145.188 ↑ 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.004..0.004 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=144977 read=523 dirtied=6
  • I/O Timings: read=23.773