explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B2HM : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #P4ZF; plan #Qeyr; plan #JpaL; plan #ima8; plan #ZFYO

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 74.403 172.393 ↑ 1.0 5,213 1

Sort (cost=4,197.83..4,210.88 rows=5,222 width=279) (actual time=171.578..172.393 rows=5,213 loops=1)

  • Sort Key: cao.cao_orden, pro.pro_nombre
  • Sort Method: quicksort Memory: 1559kB
2. 6.574 97.990 ↑ 1.0 5,213 1

Hash Left Join (cost=1,511.06..3,875.36 rows=5,222 width=279) (actual time=57.751..97.990 rows=5,213 loops=1)

  • Hash Cond: (pro.pro_id = sal.pro_id)
3. 25.207 89.085 ↑ 1.0 5,213 1

Hash Right Join (cost=1,379.73..3,665.35 rows=5,222 width=128) (actual time=55.327..89.085 rows=5,213 loops=1)

  • Hash Cond: ((dlp.lpr_id = cli.lpr_id) AND (dlp.pro_id = pro.pro_id))
4. 10.194 10.194 ↑ 1.0 52,080 1

Seq Scan on dlistapre dlp (cost=0.00..1,842.80 rows=52,080 width=20) (actual time=1.608..10.194 rows=52,080 loops=1)

5. 5.414 53.684 ↑ 1.0 5,213 1

Hash (cost=1,301.54..1,301.54 rows=5,213 width=120) (actual time=53.684..53.684 rows=5,213 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 819kB
6. 9.673 48.270 ↑ 1.0 5,213 1

Hash Right Join (cost=634.75..1,301.54 rows=5,213 width=120) (actual time=36.424..48.270 rows=5,213 loops=1)

  • Hash Cond: ((cao.ubi_id = cli.canton_id) AND (cao.pro_id = pro.pro_id))
7. 6.394 6.394 ↑ 1.0 24,773 1

Index Only Scan using idx_catalogo_orden_ubi_id_pro_id_orden on catalogo_orden cao (cost=0.29..478.58 rows=24,773 width=12) (actual time=0.134..6.394 rows=24,773 loops=1)

  • Heap Fetches: 0
8. 5.033 32.203 ↑ 1.0 5,213 1

Hash (cost=556.27..556.27 rows=5,213 width=120) (actual time=32.203..32.203 rows=5,213 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 836kB
9. 3.477 27.170 ↑ 1.0 5,213 1

Nested Loop Left Join (cost=457.51..556.27 rows=5,213 width=120) (actual time=20.460..27.170 rows=5,213 loops=1)

10. 3.309 23.693 ↑ 1.0 5,213 1

Hash Right Join (cost=457.24..488.61 rows=5,213 width=112) (actual time=20.403..23.693 rows=5,213 loops=1)

  • Hash Cond: (dpet.pro_id = pro.pro_id)
11. 0.039 0.039 ↓ 0.0 0 1

Seq Scan on dpedido_tmp dpet (cost=0.00..19.00 rows=900 width=4) (actual time=0.039..0.039 rows=0 loops=1)

12. 4.826 20.345 ↑ 1.0 5,213 1

Hash (cost=392.08..392.08 rows=5,213 width=112) (actual time=20.344..20.345 rows=5,213 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 795kB
13. 5.691 15.519 ↑ 1.0 5,213 1

Hash Right Join (cost=281.57..392.08 rows=5,213 width=112) (actual time=8.434..15.519 rows=5,213 loops=1)

  • Hash Cond: (pdb.pro_id = pro.pro_id)
14. 1.537 1.537 ↑ 1.0 5,208 1

Index Only Scan using idx_producto_diccionario_busqueda_pro_id on producto_diccionario_busqueda pdb (cost=0.28..97.10 rows=5,208 width=4) (actual time=0.034..1.537 rows=5,208 loops=1)

  • Heap Fetches: 0
15. 4.331 8.291 ↑ 1.0 5,213 1

Hash (cost=216.13..216.13 rows=5,213 width=112) (actual time=8.291..8.291 rows=5,213 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 795kB
16. 3.960 3.960 ↑ 1.0 5,213 1

Seq Scan on producto pro (cost=0.00..216.13 rows=5,213 width=112) (actual time=0.026..3.960 rows=5,213 loops=1)

17. 0.000 0.000 ↑ 1.0 1 5,213

Materialize (cost=0.28..2.50 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=5,213)

18. 0.044 0.044 ↑ 1.0 1 1

Index Scan using pk_cliente on cliente cli (cost=0.28..2.49 rows=1 width=8) (actual time=0.043..0.044 rows=1 loops=1)

  • Index Cond: (cli_id = 922)
19. 1.107 2.331 ↑ 1.0 3,293 1

Hash (cost=90.16..90.16 rows=3,293 width=8) (actual time=2.330..2.331 rows=3,293 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 172kB
20. 1.224 1.224 ↑ 1.0 3,293 1

Seq Scan on saldoinv sal (cost=0.00..90.16 rows=3,293 width=8) (actual time=0.064..1.224 rows=3,293 loops=1)

  • Filter: (bod_id = 1)
Planning time : 2.873 ms
Execution time : 174.939 ms