explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tGxk

Settings
# exclusive inclusive rows x rows loops node
1. 0.210 471.302 ↑ 1.0 1,000 1

Limit (cost=22,388,063.86..22,388,083.86 rows=1,000 width=76) (actual time=3.480..471.302 rows=1,000 loops=1)

  • Buffers: shared hit=379 read=333 dirtied=136
  • I/O Timings: read=365.918
2.          

CTE base_and_descendants

3. 3.947 469.217 ↑ 80,369.4 1,000 1

Recursive Union (cost=0.43..22,388,063.86 rows=80,369,366 width=395) (actual time=3.476..469.217 rows=1,000 loops=1)

  • Buffers: shared hit=379 read=333 dirtied=136
  • I/O Timings: read=365.918
4. 465.270 465.270 ↑ 1,148.3 1,000 1

Index Scan using index_namespaces_on_type_partial on public.namespaces (cost=0.43..104,880.54 rows=1,148,346 width=395) (actual time=3.454..465.270 rows=1,000 loops=1)

  • Index Cond: ((namespaces.type)::text = 'Group'::text)
  • Buffers: shared hit=379 read=333 dirtied=136
  • I/O Timings: read=365.918
5. 0.000 0.000 ↓ 0.0 0 0

Merge Join (cost=1,384,524.50..2,067,579.60 rows=7,922,102 width=395) (actual time=0.000..0.000 rows=0 loops=0)

6. 0.000 0.000 ↓ 0.0 0 0

Index Scan using index_namespaces_on_parent_id_and_id on public.namespaces namespaces_1 (cost=0.43..388,556.77 rows=1,148,346 width=322) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: ((namespaces_1.type)::text = 'Group'::text)
  • Rows Removed by Filter: 0
7. 0.000 0.000 ↓ 0.0 0 0

Materialize (cost=1,384,524.07..1,413,232.72 rows=5,741,730 width=76) (actual time=0.000..0.000 rows=0 loops=0)

8. 0.000 0.000 ↓ 0.0 0 0

Sort (cost=1,384,524.07..1,398,878.40 rows=5,741,730 width=76) (actual time=0.000..0.000 rows=0 loops=0)

  • Sort Key: base_and_descendants_1.id
9. 0.000 0.000 ↓ 0.0 0 0

WorkTable Scan on base_and_descendants base_and_descendants_1 (cost=0.00..229,669.20 rows=5,741,730 width=76) (actual time=0.000..0.000 rows=0 loops=0)

  • Filter: (NOT base_and_descendants_1.tree_cycle)
  • Rows Removed by Filter: 0
10. 471.092 471.092 ↑ 80,369.4 1,000 1

CTE Scan on base_and_descendants (cost=0.00..1,607,387.32 rows=80,369,366 width=76) (actual time=3.479..471.092 rows=1,000 loops=1)

  • Buffers: shared hit=379 read=333 dirtied=136
  • I/O Timings: read=365.918