explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Yiyb : Optimization for: plan #gUew

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 368.283 195,863.034 ↓ 0.0 0 1

Insert on temp_b (cost=65,509.77..69,133.65 rows=120,796 width=16) (actual time=195,863.034..195,863.034 rows=0 loops=1)

2. 195,494.751 195,494.751 ↓ 1.3 154,000 1

CTE Scan on gr1 (cost=65,509.77..67,925.69 rows=120,796 width=16) (actual time=0.026..195,494.751 rows=154,000 loops=1)

3.          

CTE gr1

4. 807.677 195,279.530 ↓ 1.3 154,000 1

Recursive Union (cost=0.42..65,509.77 rows=120,796 width=16) (actual time=0.024..195,279.530 rows=154,000 loops=1)

5. 0.653 0.653 ↑ 1.0 1,150 1

Index Scan using temp_a_prev_pos_id_idx on temp_a (cost=0.42..47.35 rows=1,196 width=16) (actual time=0.023..0.653 rows=1,150 loops=1)

  • Index Cond: (prev_pos_id IS NULL)
6. 41,802.880 194,471.200 ↑ 76.7 156 980

Hash Join (cost=5,055.00..6,304.65 rows=11,960 width=16) (actual time=159.446..198.440 rows=156 loops=980)

  • Hash Cond: (a.pos_id = b.prev_pos_id)
7. 58.800 58.800 ↑ 76.2 157 980

WorkTable Scan on gr1 a (cost=0.00..239.20 rows=11,960 width=8) (actual time=0.001..0.060 rows=157 loops=980)

8. 100,915.500 152,609.520 ↑ 1.0 152,850 980

Hash (cost=2,378.00..2,378.00 rows=154,000 width=16) (actual time=155.724..155.724 rows=152,850 loops=980)

  • Buckets: 131072 Batches: 4 Memory Usage: 2812kB
9. 51,694.020 51,694.020 ↑ 1.0 154,000 980

Seq Scan on temp_a b (cost=0.00..2,378.00 rows=154,000 width=16) (actual time=0.010..52.749 rows=154,000 loops=980)