explain.depesz.com

PostgreSQL's explain analyze made readable

Result: e3gm

Settings
# exclusive inclusive rows x rows loops node
1. 0.142 16,009.349 ↑ 1.0 1 1

Aggregate (cost=3.25..3.26 rows=1 width=32) (actual time=16,009.349..16,009.349 rows=1 loops=1)

2.          

CTE r

3. 0.809 16,009.040 ↑ 44.8 100 1

Recursive Union (cost=0.42..941,340.99 rows=4,481 width=37) (actual time=0.033..16,009.040 rows=100 loops=1)

4. 0.033 0.033 ↑ 1.0 1 1

Index Scan using boi_rel_pkey on boi_rel rel (cost=0.42..8.44 rows=1 width=37) (actual time=0.032..0.033 rows=1 loops=1)

  • Index Cond: (id = 428282)
  • Filter: (NOT is_deleted)
5. 1,553.482 16,008.198 ↑ 448.0 1 74

Hash Join (cost=0.35..94,124.29 rows=448 width=37) (actual time=0.130..216.327 rows=1 loops=74)

  • Hash Cond: ((rel2.from_bo_instance_id = r_1.to_id) AND (rel2.boc_rel_type_id = r_1.rel_type_id))
  • Join Filter: ((r_1.from_id <> rel2.to_bo_instance_id) AND (r_1.id <> rel2.id))
  • Rows Removed by Join Filter: 1
6. 14,454.420 14,454.420 ↑ 1.0 309,650 74

Seq Scan on boi_rel rel2 (cost=0.00..91,792.55 rows=309,807 width=33) (actual time=0.003..195.330 rows=309,650 loops=74)

  • Filter: (NOT is_deleted)
  • Rows Removed by Filter: 263
7. 0.222 0.296 ↑ 10.0 1 74

Hash (cost=0.20..0.20 rows=10 width=36) (actual time=0.004..0.004 rows=1 loops=74)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
8. 0.074 0.074 ↑ 10.0 1 74

WorkTable Scan on r r_1 (cost=0.00..0.20 rows=10 width=36) (actual time=0.001..0.001 rows=1 loops=74)

9. 0.047 16,009.207 ↑ 1.0 100 1

Limit (cost=0.00..2.00 rows=100 width=37) (actual time=0.036..16,009.207 rows=100 loops=1)

10. 16,009.160 16,009.160 ↑ 44.8 100 1

CTE Scan on r (cost=0.00..89.62 rows=4,481 width=37) (actual time=0.035..16,009.160 rows=100 loops=1)

Planning time : 0.311 ms
Execution time : 16,009.427 ms