explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Rlm4 : Optimization for: Slow; plan FAST

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 52.467 369.207 ↓ 7.3 1,853 1

Hash Left Join (cost=25,653.87..34,117.03 rows=254 width=200) (actual time=297.877..369.207 rows=1,853 loops=1)

  • Hash Cond: (o.objekti_id = d.objekti_id)
2. 1.406 19.661 ↓ 7.3 1,853 1

Hash Join (cost=4.92..7,984.20 rows=254 width=302) (actual time=0.083..19.661 rows=1,853 loops=1)

  • Hash Cond: (o.fishnet_id = f.fishnet_id)
3. 18.220 18.220 ↓ 1.0 7,192 1

Seq Scan on objekti o (cost=0.00..7,949.81 rows=7,179 width=302) (actual time=0.016..18.220 rows=7,192 loops=1)

  • Filter: (projekti_id = 10)
  • Rows Removed by Filter: 68458
4. 0.008 0.035 ↓ 1.6 13 1

Hash (cost=4.83..4.83 rows=8 width=12) (actual time=0.035..0.035 rows=13 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
5. 0.027 0.027 ↓ 1.6 13 1

Seq Scan on fishnet f (cost=0.00..4.83 rows=8 width=12) (actual time=0.009..0.027 rows=13 loops=1)

  • Filter: (fishnet_sifra = 3)
  • Rows Removed by Filter: 188
6. 14.295 297.079 ↓ 378.2 75,649 1

Hash (cost=25,646.45..25,646.45 rows=200 width=12) (actual time=297.079..297.079 rows=75,649 loops=1)

  • Buckets: 131072 (originally 1024) Batches: 2 (originally 1) Memory Usage: 3073kB
7. 6.183 282.784 ↓ 378.2 75,649 1

Subquery Scan on d (cost=25,642.45..25,646.45 rows=200 width=12) (actual time=261.805..282.784 rows=75,649 loops=1)

8. 48.948 276.601 ↓ 378.2 75,649 1

HashAggregate (cost=25,642.45..25,644.45 rows=200 width=52) (actual time=261.804..276.601 rows=75,649 loops=1)

  • Group Key: kk.objekti_id
9. 41.050 227.653 ↓ 1.0 104,876 1

GroupAggregate (cost=16,289.08..24,070.58 rows=104,791 width=40) (actual time=89.741..227.653 rows=104,876 loops=1)

  • Group Key: kk.katovi_id
10. 38.373 186.603 ↓ 1.0 131,722 1

Merge Left Join (cost=16,289.08..22,381.39 rows=128,256 width=20) (actual time=89.726..186.603 rows=131,722 loops=1)

  • Merge Cond: (kk.katovi_id = ddd.katovi_id)
11. 28.669 28.669 ↓ 1.0 104,876 1

Index Scan using katovi_pkey on katovi kk (cost=0.29..3,592.75 rows=104,791 width=12) (actual time=0.006..28.669 rows=104,876 loops=1)

12. 10.709 119.561 ↓ 1.0 131,721 1

Materialize (cost=16,288.73..16,930.01 rows=128,256 width=16) (actual time=89.715..119.561 rows=131,721 loops=1)

13. 88.854 108.852 ↓ 1.0 131,721 1

Sort (cost=16,288.73..16,609.37 rows=128,256 width=16) (actual time=89.708..108.852 rows=131,721 loops=1)

  • Sort Key: ddd.katovi_id
  • Sort Method: external merge Disk: 3344kB
14. 19.998 19.998 ↓ 1.0 131,721 1

Seq Scan on dijelovi ddd (cost=0.00..3,212.56 rows=128,256 width=16) (actual time=0.010..19.998 rows=131,721 loops=1)

Planning time : 0.473 ms
Execution time : 372.947 ms