explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 57.483 122.318 ↑ 1.0 5,213 1

Sort (cost=4,133.13..4,146.18 rows=5,222 width=279) (actual time=121.560..122.318 rows=5,213 loops=1)

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

Hash Left Join (cost=1,446.36..3,810.66 rows=5,222 width=279) (actual time=42.869..64.835 rows=5,213 loops=1)

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

Hash Right Join (cost=1,315.03..3,600.65 rows=5,222 width=128) (actual time=41.477..60.069 rows=5,213 loops=1)

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

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

5. 3.412 40.360 ↑ 1.0 5,213 1

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

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

Hash Right Join (cost=570.05..1,236.84 rows=5,213 width=120) (actual time=27.352..36.948 rows=5,213 loops=1)

  • Hash Cond: ((cao.ubi_id = cli.canton_id) AND (cao.pro_id = pro.pro_id))
7. 4.472 4.472 ↑ 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.050..4.472 rows=24,773 loops=1)

  • Heap Fetches: 0
8. 5.222 25.143 ↑ 1.0 5,213 1

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

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

Nested Loop Left Join (cost=294.10..491.57 rows=5,213 width=120) (actual time=8.372..19.921 rows=5,213 loops=1)

10. 1.900 16.220 ↑ 1.0 5,213 1

Hash Left Join (cost=293.82..423.91 rows=5,213 width=112) (actual time=8.318..16.220 rows=5,213 loops=1)

  • Hash Cond: (pro.pro_id = dpet.pro_id)
11. 4.664 14.306 ↑ 1.0 5,213 1

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

  • Hash Cond: (pdb.pro_id = pro.pro_id)
12. 1.514 1.514 ↑ 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.066..1.514 rows=5,208 loops=1)

  • Heap Fetches: 0
13. 4.238 8.128 ↑ 1.0 5,213 1

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

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

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

15. 0.001 0.014 ↓ 0.0 0 1

Hash (cost=12.20..12.20 rows=4 width=4) (actual time=0.014..0.014 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.004 0.013 ↓ 0.0 0 1

Bitmap Heap Scan on dpedido_tmp dpet (cost=8.00..12.20 rows=4 width=4) (actual time=0.013..0.013 rows=0 loops=1)

  • Recheck Cond: (cor_id = 0)
17. 0.009 0.009 ↓ 0.0 0 1

Bitmap Index Scan on idx_dpedido_tmp_cor_id (cost=0.00..8.00 rows=4 width=0) (actual time=0.009..0.009 rows=0 loops=1)

  • Index Cond: (cor_id = 0)
18. 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)

19. 0.041 0.041 ↑ 1.0 1 1

Index Scan using idx_cliente_cli_id_lpr_id on cliente cli (cost=0.28..2.49 rows=1 width=8) (actual time=0.039..0.041 rows=1 loops=1)

  • Index Cond: (cli_id = 922)
20. 0.658 1.339 ↑ 1.0 3,293 1

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

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

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

  • Filter: (bod_id = 1)
Planning time : 1.850 ms
Execution time : 124.793 ms