explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BurN

Settings
# exclusive inclusive rows x rows loops node
1. 0.169 6,943.653 ↑ 1.5 4 1

WindowAgg (cost=739,561.03..739,562.77 rows=6 width=811) (actual time=6,943.605..6,943.653 rows=4 loops=1)

2. 0.093 6,943.484 ↑ 1.5 4 1

Sort (cost=739,561.03..739,561.05 rows=6 width=811) (actual time=6,943.483..6,943.484 rows=4 loops=1)

  • Sort Key: v010101.almacen, v010101.pedido, (CASE WHEN (COALESCE((mm_v010101.orden)::integer, 0) <> 0) THEN ((v010101.od_linea * 10000) + mm_v010101.vinculo) ELSE mm_v010101.vinculo END), v010101.od_linea, mm_v010101.orden
  • Sort Method: quicksort Memory: 27kB
3. 0.017 6,943.391 ↑ 1.5 4 1

Nested Loop Left Join (cost=713,195.65..739,560.96 rows=6 width=811) (actual time=6,942.978..6,943.391 rows=4 loops=1)

4. 0.022 6,943.374 ↑ 1.5 4 1

Nested Loop Left Join (cost=713,195.51..739,559.88 rows=6 width=808) (actual time=6,942.969..6,943.374 rows=4 loops=1)

5. 0.018 6,943.332 ↑ 1.5 4 1

Nested Loop Left Join (cost=713,195.08..739,557.07 rows=6 width=820) (actual time=6,942.949..6,943.332 rows=4 loops=1)

  • Join Filter: (direcciones.orden = v0101.orden)
  • Rows Removed by Join Filter: 40
6. 0.014 6,943.254 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,194.67..739,556.62 rows=1 width=792) (actual time=6,942.915..6,943.254 rows=4 loops=1)

7. 0.009 6,943.196 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,194.24..739,556.13 rows=1 width=805) (actual time=6,942.881..6,943.196 rows=4 loops=1)

8. 0.014 6,943.163 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,193.82..739,555.66 rows=1 width=799) (actual time=6,942.864..6,943.163 rows=4 loops=1)

9. 0.008 6,943.129 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,193.39..739,555.18 rows=1 width=770) (actual time=6,942.845..6,943.129 rows=4 loops=1)

10. 0.035 6,943.093 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,192.97..739,548.99 rows=1 width=734) (actual time=6,942.827..6,943.093 rows=4 loops=1)

11. 0.009 6,943.058 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,192.81..739,548.81 rows=1 width=725) (actual time=6,942.801..6,943.058 rows=4 loops=1)

12. 0.003 6,943.049 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,192.39..739,548.35 rows=1 width=721) (actual time=6,942.796..6,943.049 rows=4 loops=1)

13. 0.011 6,943.042 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,191.96..739,547.89 rows=1 width=712) (actual time=6,942.792..6,943.042 rows=4 loops=1)

14. 0.010 6,942.995 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,191.41..739,547.06 rows=1 width=450) (actual time=6,942.769..6,942.995 rows=4 loops=1)

15. 0.010 6,942.949 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,190.98..739,542.82 rows=1 width=270) (actual time=6,942.746..6,942.949 rows=4 loops=1)

  • Join Filter: (x1401.tipo = ANY ('{3,4,5,7,8,9,10,11,12,13,14,20,21,22,23,24,25}'::integer[]))
16. 0.022 6,939.263 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,190.55..739,542.29 rows=1 width=248) (actual time=6,939.075..6,939.263 rows=4 loops=1)

  • Join Filter: ((x1401.unidad_gest_1)::text = (m0304.unidad_gest_1)::text)
  • Rows Removed by Join Filter: 12
17. 0.009 6,939.233 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,190.55..739,541.22 rows=1 width=246) (actual time=6,939.063..6,939.233 rows=4 loops=1)

18. 0.011 6,939.204 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,190.26..739,540.89 rows=1 width=225) (actual time=6,939.048..6,939.204 rows=4 loops=1)

19. 0.014 6,939.153 ↓ 4.0 4 1

Nested Loop Left Join (cost=713,189.84..739,540.31 rows=1 width=204) (actual time=6,939.023..6,939.153 rows=4 loops=1)

20. 0.011 6,939.095 ↓ 4.0 4 1

Nested Loop (cost=713,189.41..739,539.79 rows=1 width=155) (actual time=6,938.996..6,939.095 rows=4 loops=1)

  • Join Filter: (v010101.empresa = m0301.empresa)
21. 0.016 6,939.052 ↓ 4.0 4 1

Nested Loop (cost=713,188.98..739,539.30 rows=1 width=167) (actual time=6,938.974..6,939.052 rows=4 loops=1)

22. 24.351 6,938.992 ↓ 4.0 4 1

Hash Join (cost=713,188.56..739,535.10 rows=1 width=144) (actual time=6,938.937..6,938.992 rows=4 loops=1)

  • Hash Cond: ((tconsumoini.emp = v010101.empresa) AND (tconsumoini.eje = v010101.ejercicio) AND ((tconsumoini.alm)::text = (v010101.almacen)::text) AND ((tconsumoini.td)::text = (v010101.tipo_movimiento)::text) AND (tconsumoini.ped = v010101.pedido))
  • Join Filter: (((v010101.od_linea = tconsumoini.odl) AND (tconsumoini.odl <> 0)) OR ((v010101.od_linea > tconsumoini.odl) AND (tconsumoini.odl = 0)))
23. 0.011 0.011 ↑ 540.0 1 1

Seq Scan on tconsumoini (cost=0.00..15.40 rows=540 width=68) (actual time=0.009..0.011 rows=1 loops=1)

24. 184.615 6,914.630 ↑ 5.0 276,844 1

Hash (cost=664,135.99..664,135.99 rows=1,393,714 width=78) (actual time=6,914.630..6,914.630 rows=276,844 loops=1)

  • Buckets: 131072 Batches: 2 Memory Usage: 14419kB
25. 6,586.875 6,730.015 ↑ 5.0 276,844 1

Seq Scan on v010101 (cost=13,776.02..664,135.99 rows=1,393,714 width=78) (actual time=143.733..6,730.015 rows=276,844 loops=1)

  • Filter: (((articulo)::text !~~ '..%'::text) AND (NOT (hashed SubPlan 1)) AND ((cantidad - cantidad_s) > 0::numeric) AND (("substring"((campo1)::text, 1, 6) <> 'BLQFAB'::text) OR ("substring"((campo1)::text, 1, 6) IS NULL) OR ("current_user"() = 'pgjalti'::name) OR ("substring"((campo1)::text, 1, 8) = 'BLQFABRP'::text) OR ("substring"((campo1)::text, 1, 8) = 'BLQFABCJ'::text) OR ("substring"((campo1)::text, 1, 18) = 'BLQFAB-SERIEMANUAL'::text)))
  • Rows Removed by Filter: 8155262
26.          

SubPlan (forSeq Scan)

27. 143.140 143.140 ↑ 1.4 856 1

Seq Scan on m0301 m0301_1 (cost=0.00..13,772.96 rows=1,221 width=14) (actual time=0.295..143.140 rows=856 loops=1)

  • Filter: ((codigo_a)::text = ANY ('{Z40,D01}'::text[]))
  • Rows Removed by Filter: 648601
28. 0.044 0.044 ↑ 1.0 1 4

Index Scan using m0304_1 on m0304 (cost=0.42..4.19 rows=1 width=23) (actual time=0.011..0.011 rows=1 loops=4)

  • Index Cond: (((codigo)::text = (COALESCE(v010101.articulo, tconsumoini.art_m))::text) AND (empresa = v010101.empresa))
29. 0.032 0.032 ↑ 1.0 1 4

Index Scan using m0301_pkey on m0301 (cost=0.42..0.48 rows=1 width=20) (actual time=0.007..0.008 rows=1 loops=4)

  • Index Cond: (((codigo)::text = (m0304.codigo)::text) AND (empresa = m0304.empresa))
30. 0.044 0.044 ↑ 1.0 1 4

Index Scan using v0101_1 on v0101 (cost=0.43..0.51 rows=1 width=49) (actual time=0.010..0.011 rows=1 loops=4)

  • Index Cond: ((empresa = v010101.empresa) AND (ejercicio = v010101.ejercicio) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND (documento = v010101.pedido))
31. 0.040 0.040 ↑ 1.0 1 4

Index Scan using vxx03_1 on vxx03 (cost=0.43..0.58 rows=1 width=38) (actual time=0.010..0.010 rows=1 loops=4)

  • Index Cond: ((empresa = v0101.empresa) AND (ejercicio = v0101.ejercicio) AND ((almacen)::text = (v0101.almacen)::text) AND ((tipo_doc)::text = (v0101.tipo_doc)::text) AND (documento = v0101.documento))
32. 0.020 0.020 ↓ 0.0 0 4

Index Scan using manual_2 on manual (cost=0.29..0.32 rows=1 width=33) (actual time=0.005..0.005 rows=0 loops=4)

  • Index Cond: ((documento = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa))
33. 0.008 0.008 ↑ 1.0 3 4

Seq Scan on x1401 (cost=0.00..1.03 rows=3 width=5) (actual time=0.002..0.002 rows=3 loops=4)

34. 3.676 3.676 ↓ 0.0 0 4

Index Scan using vxxxx09_pkey on vxxxx09 (cost=0.43..0.50 rows=1 width=38) (actual time=0.919..0.919 rows=0 loops=4)

  • Index Cond: ((documento = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_movimiento)::text = (v010101.tipo_movimiento)::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa) AND (linea_documento = v010101.od_linea))
35. 0.036 0.036 ↑ 1.0 1 4

Index Scan using masco_ftart01 on masco_ftart (cost=0.42..4.23 rows=1 width=194) (actual time=0.009..0.009 rows=1 loops=4)

  • Index Cond: ((codigo)::text = (COALESCE(v010101.articulo, tconsumoini.art_m))::text)
36. 0.036 0.036 ↑ 1.0 1 4

Index Scan using mm_v010101_pkey on mm_v010101 (cost=0.56..0.82 rows=1 width=280) (actual time=0.008..0.009 rows=1 loops=4)

  • Index Cond: ((pedido = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa) AND (od_linea = v010101.od_linea))
37. 0.004 0.004 ↓ 0.0 0 4

Index Scan using masco_ftart01 on masco_ftart mm_masco_ftart (cost=0.42..0.45 rows=1 width=23) (actual time=0.001..0.001 rows=0 loops=4)

  • Index Cond: ((codigo)::text = (mm_v010101.componente)::text)
38. 0.000 0.000 ↓ 0.0 0 4

Index Scan using masco_ftart01 on masco_ftart tirador_masco_ftart (cost=0.42..0.45 rows=1 width=18) (actual time=0.000..0.000 rows=0 loops=4)

  • Index Cond: ((codigo)::text = (mm_v010101.codigo_tirador)::text)
39. 0.000 0.000 ↓ 0.0 0 4

Index Scan using m_planmeca_pkey on m_planmeca (cost=0.15..0.17 rows=1 width=18) (actual time=0.000..0.000 rows=0 loops=4)

  • Index Cond: ((mecanizado)::text = (COALESCE(CASE btrim((mm_v010101.mecanizado)::text) WHEN ''::text THEN NULL::character varying ELSE mm_v010101.mecanizado END, CASE btrim((masco_ftart.planmeca)::text) WHEN ''::text THEN NULL::character varying ELSE masco_ftart.planmeca END))::text)
40. 0.028 0.028 ↑ 2.0 1 4

Index Scan using m0302_2 on m0302 (cost=0.43..6.18 rows=2 width=52) (actual time=0.007..0.007 rows=1 loops=4)

  • Index Cond: (((codigo)::text = (COALESCE(v010101.articulo, tconsumoini.art_m))::text) AND (tipo = 0) AND (empresa = tconsumoini.emp))
41. 0.020 0.020 ↓ 0.0 0 4

Index Scan using vxxxx01_1 on vxxxx01 (cost=0.42..0.46 rows=1 width=50) (actual time=0.005..0.005 rows=0 loops=4)

  • Index Cond: ((documento = v010101.pedido) AND ((almacen)::text = (v010101.almacen)::text) AND ((tipo_doc)::text = (v010101.tipo_movimiento)::text) AND (ejercicio = v010101.ejercicio) AND (empresa = v010101.empresa) AND (orden = v010101.linea_pedido))
42. 0.024 0.024 ↑ 1.0 1 4

Index Scan using edi_procesado02 on edi_procesado (cost=0.42..0.46 rows=1 width=23) (actual time=0.006..0.006 rows=1 loops=4)

  • Index Cond: ((documento_pv = v0101.documento) AND ((almacen_pv)::text = (v0101.almacen)::text) AND (ejercicio_pv = v0101.ejercicio) AND (empresa_pv = v0101.empresa))
43. 0.044 0.044 ↑ 1.0 1 4

Index Scan using masco_rutes01 on masco_rutes (cost=0.43..0.49 rows=1 width=17) (actual time=0.011..0.011 rows=1 loops=4)

  • Index Cond: (((su)::text = (v0101.subcta)::text) AND (ord = v0101.orden) AND ((almacen)::text = (CASE WHEN ((v0101.almacen)::text = '25'::text) THEN v0101.almacen ELSE '00'::character varying END)::text) AND (em = v0101.empresa))
44. 0.060 0.060 ↓ 11.0 11 4

Index Scan using direcciones_1 on direcciones (cost=0.41..0.44 rows=1 width=42) (actual time=0.008..0.015 rows=11 loops=4)

  • Index Cond: ((empresa = v010101.empresa) AND ((subcta)::text = (v010101.subcta)::text))
45. 0.020 0.020 ↑ 1.0 1 4

Index Scan using direcciones_1 on direcciones diredi (cost=0.42..0.46 rows=1 width=38) (actual time=0.005..0.005 rows=1 loops=4)

  • Index Cond: ((empresa = v010101.empresa) AND ((subcta)::text = ((COALESCE(mm_v010101.edi_subcta_desti, edi_procesado.subcta_desti))::character varying(9))::text) AND (orden = ("substring"((COALESCE(mm_v010101.edi_subcta_desti, edi_procesado.subcta_desti))::text, 10, 3))::integer))
46. 0.000 0.000 ↓ 0.0 0 4

Index Scan using m_rutasprov_pkey on m_rutasprov (cost=0.15..0.17 rows=1 width=7) (actual time=0.000..0.000 rows=0 loops=4)

  • Index Cond: (((almacen)::text = '00'::text) AND (provincia = COALESCE(manual.provincia, direcciones.provincia)) AND (pais = COALESCE(manual.pais, direcciones.pais)))
Planning time : 80.420 ms
Execution time : 6,946.473 ms