explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 75.976 166.328 ↑ 1.0 5,213 1

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

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

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

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

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

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

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

5. 4.743 46.560 ↑ 1.0 5,213 1

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

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

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

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

  • Heap Fetches: 0
8. 5.368 26.256 ↑ 1.0 5,213 1

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

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

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

10. 2.055 16.987 ↑ 1.0 5,213 1

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

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

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

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

  • Heap Fetches: 0
13. 4.266 8.130 ↑ 1.0 5,213 1

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

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

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

15. 0.001 0.011 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.002 0.010 ↓ 0.0 0 1

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

  • Recheck Cond: (cor_id = 0)
17. 0.008 0.008 ↓ 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.008..0.008 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.028 0.028 ↑ 1.0 1 1

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

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

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

  • Buckets: 4096 Batches: 1 Memory Usage: 172kB
21. 1.516 1.516 ↑ 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.516 rows=3,293 loops=1)

  • Filter: (bod_id = 1)
Planning time : 3.097 ms
Execution time : 168.979 ms