explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sac4

Settings
# exclusive inclusive rows x rows loops node
1. 0.357 587.879 ↑ 1.0 1 1

Aggregate (cost=3,484,939.47..3,484,939.48 rows=1 width=8) (actual time=587.878..587.879 rows=1 loops=1)

2. 9.927 587.522 ↑ 78.7 2,020 1

Hash Join (cost=3,357,989.26..3,484,144.16 rows=159,061 width=8) (actual time=479.341..587.522 rows=2,020 loops=1)

  • Hash Cond: (pxp.pxp_presid = pre.pre_id)
3. 35.339 517.545 ↑ 81.2 2,034 1

Hash Join (cost=3,353,079.53..3,474,253.06 rows=165,231 width=12) (actual time=418.620..517.545 rows=2,034 loops=1)

  • Hash Cond: (pro.pro_id = linp.linp_pedid)
4. 75.337 75.357 ↑ 1.0 65,477 1

Seq Scan on proyecto pro (cost=0.00..105,196.21 rows=65,982 width=4) (actual time=0.028..75.357 rows=65,477 loops=1)

  • Filter: ((((pro_grupo_seguimiento)::text = 'enprod'::text) OR (((pro_grupo_seguimiento)::text = 'acc'::text) AND ((pro_fecha_contacto >= '2019-02-01'::date) OR (pro_fecha_iniserv >= '2019-02-01'::date) OR (pro_fecha_ini >= '2019-02-01 00:00:00'::timestamp without time zone)))) AND ((pro_idalmacensalidaprevista IS NULL) OR (NOT (alternatives: SubPlan 3 or hashed SubPlan 4))))
  • Rows Removed by Filter: 18414
5.          

SubPlan (forSeq Scan)

6. 0.000 0.000 ↓ 0.0 0

Seq Scan on almacen almped (cost=0.00..1.12 rows=1 width=0) (never executed)

  • Filter: ((pro.pro_idalmacensalidaprevista = alm_id) AND (alm_endeposito = 1))
7. 0.020 0.020 ↓ 2.7 16 1

Seq Scan on almacen almped (cost=0.00..1.10 rows=6 width=4) (actual time=0.016..0.020 rows=16 loops=1)

  • Filter: (alm_endeposito = 1)
  • Rows Removed by Filter: 5
8. 8.908 406.849 ↑ 94.5 2,221 1

Hash (cost=3,349,430.58..3,349,430.58 rows=209,916 width=16) (actual time=406.849..406.849 rows=2,221 loops=1)

  • Buckets: 4096 Batches: 16 Memory Usage: 7kB
9. 0.547 397.941 ↑ 94.5 2,221 1

Hash Left Join (cost=3,326,234.62..3,349,430.58 rows=209,916 width=16) (actual time=182.695..397.941 rows=2,221 loops=1)

  • Hash Cond: (linp.linp_prodid = lpa.lpa_idpack)
10. 125.289 397.368 ↑ 94.5 2,221 1

Hash Join (cost=3,326,199.54..3,347,555.77 rows=209,916 width=16) (actual time=182.653..397.368 rows=2,221 loops=1)

  • Hash Cond: (pxp.pxp_linpid = linp.linp_id)
11. 95.751 95.751 ↑ 1.0 416,115 1

Seq Scan on productospres pxp (cost=0.00..12,405.04 rows=417,604 width=8) (actual time=0.012..95.751 rows=416,115 loops=1)

12. 6.303 176.328 ↑ 92.2 2,172 1

Hash (cost=3,322,717.91..3,322,717.91 rows=200,291 width=16) (actual time=176.328..176.328 rows=2,172 loops=1)

  • Buckets: 4096 Batches: 16 Memory Usage: 8kB
13. 169.951 170.025 ↑ 92.2 2,172 1

Seq Scan on lineaxpedido linp (cost=0.00..3,322,717.91 rows=200,291 width=16) (actual time=6.473..170.025 rows=2,172 loops=1)

  • Filter: ((linp_prodid = 8635) OR (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Rows Removed by Filter: 396580
14.          

SubPlan (forSeq Scan)

15. 0.000 0.000 ↓ 0.0 0

Index Scan using lpaidpack_idx on linea_pack lpaaux (cost=0.00..8.27 rows=1 width=0) (never executed)

  • Index Cond: (linp.linp_prodid = lpa_idpack)
  • Filter: (lpa_idproducto = 8635)
16. 0.074 0.074 ↓ 1.1 15 1

Index Scan using lpaidproducto_idx on linea_pack lpaaux (cost=0.00..34.90 rows=14 width=4) (actual time=0.031..0.074 rows=15 loops=1)

  • Index Cond: (lpa_idproducto = 8635)
17. 0.005 0.026 ↓ 1.1 15 1

Hash (cost=34.90..34.90 rows=14 width=8) (actual time=0.026..0.026 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
18. 0.021 0.021 ↓ 1.1 15 1

Index Scan using lpaidproducto_idx on linea_pack lpa (cost=0.00..34.90 rows=14 width=8) (actual time=0.013..0.021 rows=15 loops=1)

  • Index Cond: (lpa_idproducto = 8635)
19. 20.283 60.050 ↑ 1.0 83,642 1

Hash (cost=3,520.39..3,520.39 rows=84,667 width=4) (actual time=60.050..60.050 rows=83,642 loops=1)

  • Buckets: 4096 Batches: 4 Memory Usage: 748kB
20. 39.767 39.767 ↑ 1.0 83,642 1

Seq Scan on presupuesto pre (cost=0.00..3,520.39 rows=84,667 width=4) (actual time=0.035..39.767 rows=83,642 loops=1)

  • Filter: (pre_activo = B'1'::"bit")
  • Rows Removed by Filter: 3265