explain.depesz.com

PostgreSQL's explain analyze made readable

Result: X8MB

Settings
# exclusive inclusive rows x rows loops node
1. 46.518 7,644.673 ↓ 30,629.0 30,629 1

GroupAggregate (cost=43,461.43..43,461.54 rows=1 width=348) (actual time=7,593.614..7,644.673 rows=30,629 loops=1)

  • Group Key: territorio.ter_scodterritorio, territorio.ter_sdesterritorio, cliente.cli_nrutcliente, cliente.cli_sdigverificador, local_cliente.loc_nnumlocal, (((((btrim((cliente.cli_snombre)::text) || ' '::text) || btrim((cliente.cli_sapepaterno)::text)) | (...)
2. 493.176 7,598.155 ↓ 30,629.0 30,629 1

Sort (cost=43,461.43..43,461.44 rows=1 width=316) (actual time=7,593.583..7,598.155 rows=30,629 loops=1)

  • Sort Key: territorio.ter_scodterritorio, territorio.ter_sdesterritorio, cliente.cli_nrutcliente, cliente.cli_sdigverificador, local_cliente.loc_nnumlocal, (((((btrim((cliente.cli_snombre)::text) || ' '::text) || btrim((cliente.cli_sapepaterno)::tex (...)
  • Sort Method: quicksort Memory: 9675kB
3. 28.494 7,104.979 ↓ 30,629.0 30,629 1

Nested Loop Left Join (cost=43,410.44..43,461.42 rows=1 width=316) (actual time=6,376.751..7,104.979 rows=30,629 loops=1)

4. 8.776 6,862.082 ↓ 30,629.0 30,629 1

Nested Loop Left Join (cost=43,410.02..43,460.85 rows=1 width=297) (actual time=6,376.714..6,862.082 rows=30,629 loops=1)

5. 11.799 6,792.048 ↓ 30,629.0 30,629 1

Nested Loop (cost=43,409.88..43,460.69 rows=1 width=283) (actual time=6,376.696..6,792.048 rows=30,629 loops=1)

6. 33.819 6,627.104 ↓ 30,629.0 30,629 1

Nested Loop (cost=43,409.46..43,460.16 rows=1 width=252) (actual time=6,376.665..6,627.104 rows=30,629 loops=1)

7. 58.371 6,440.140 ↓ 5,104.8 30,629 1

GroupAggregate (cost=43,409.04..43,409.43 rows=6 width=234) (actual time=6,376.600..6,440.140 rows=30,629 loops=1)

  • Group Key: jerarquia_linea.jli_sdeslinea, jerarquia_categoria.jca_sdescategoria, jerarquia_productobase.jpb_sdesproductobase, articulo.art_scodformato, articulo.art_scodvariedad, articulo.art_sdescripcion, relacion_com (...)
8. 428.725 6,381.769 ↓ 5,620.5 33,723 1

Sort (cost=43,409.04..43,409.05 rows=6 width=234) (actual time=6,376.569..6,381.769 rows=33,723 loops=1)

  • Sort Key: jerarquia_linea.jli_sdeslinea, jerarquia_categoria.jca_sdescategoria, jerarquia_productobase.jpb_sdesproductobase, articulo.art_scodformato, articulo.art_scodvariedad, articulo.art_sdescripcion, relacio (...)
  • Sort Method: quicksort Memory: 10492kB
9. 3.909 5,953.044 ↓ 5,620.5 33,723 1

Append (cost=9,459.01..43,408.96 rows=6 width=234) (actual time=1,813.525..5,953.044 rows=33,723 loops=1)

10. 70.255 1,891.469 ↓ 29,198.0 29,198 1

GroupAggregate (cost=9,459.01..9,459.12 rows=1 width=234) (actual time=1,813.524..1,891.469 rows=29,198 loops=1)

  • Group Key: jerarquia_linea.jli_sdeslinea, jerarquia_categoria.jca_sdescategoria, jerarquia_productobase.jpb_sdesproductobase, articulo.art_scodformato, articulo.art_scodvariedad, relacion_comer_localc (...)
11. 323.425 1,821.214 ↓ 36,199.0 36,199 1

Sort (cost=9,459.01..9,459.02 rows=1 width=192) (actual time=1,813.494..1,821.214 rows=36,199 loops=1)

  • Sort Key: jerarquia_linea.jli_sdeslinea, jerarquia_categoria.jca_sdescategoria, jerarquia_productobase.jpb_sdesproductobase, articulo.art_scodformato, articulo.art_scodvariedad, relacion_comer_l (...)
  • Sort Method: quicksort Memory: 11152kB
12. 102.327 1,497.789 ↓ 36,199.0 36,199 1

Nested Loop Left Join (cost=5,452.14..9,459.00 rows=1 width=192) (actual time=30.704..1,497.789 rows=36,199 loops=1)

  • Join Filter: ((jerarquia_categoria.jca_scodlinea)::text = (jerarquia_linea.jli_scodlinea)::text)
  • Rows Removed by Join Filter: 55777
13. 32.093 1,359.263 ↓ 36,199.0 36,199 1

Nested Loop Left Join (cost=5,452.14..9,457.61 rows=1 width=164) (actual time=30.678..1,359.263 rows=36,199 loops=1)

14. 20.503 603.190 ↓ 36,199.0 36,199 1

Nested Loop (cost=5,447.96..9,451.62 rows=1 width=150) (actual time=30.613..603.190 rows=36,199 loops=1)

15. 26.019 437.891 ↓ 36,199.0 36,199 1

Nested Loop (cost=5,447.68..9,445.45 rows=1 width=134) (actual time=30.598..437.891 rows=36,199 loops=1)

16. 16.096 192.716 ↓ 36,526.0 36,526 1

Nested Loop (cost=5,447.40..9,439.05 rows=1 width=94) (actual time=30.573..192.716 rows=36,526 loops=1)

17. 17.576 51.780 ↓ 594.5 12,484 1

Hash Join (cost=5,446.83..9,257.29 rows=21 width=83) (actual time=30.538..51.780 rows=12,484 loops=1)

  • Hash Cond: ((factura.fac_nrutcliente = relacion_comer_localcliente.rco_nrutcliente) AND (factura.fac_nnumlocal = relacion_comer_localcliente.rco_nnumlocal))
18. 3.786 4.844 ↓ 4.7 4,256 1

Bitmap Heap Scan on factura (cost=38.50..3,607.34 rows=911 width=26) (actual time=1.146..4.844 rows=4,256 loops=1)

  • Recheck Cond: ((fac_nrutoperador = '76501303'::numeric) AND (fac_dfhoemision >= to_date('01/12/2017'::character varying, 'dd/mm/yyyy'::character varying (...)
  • Heap Blocks: exact=728
19. 1.058 1.058 ↓ 4.7 4,256 1

Bitmap Index Scan on idx_factura_idx02 (cost=0.00..38.27 rows=911 width=0) (actual time=1.058..1.058 rows=4,256 loops=1)

  • Index Cond: ((fac_nrutoperador = '76501303'::numeric) AND (fac_dfhoemision >= to_date('01/12/2017'::character varying, 'dd/mm/yyyy'::character var (...)
20. 9.691 29.360 ↓ 5.1 18,665 1

Hash (cost=5,352.91..5,352.91 rows=3,695 width=68) (actual time=29.360..29.360 rows=18,665 loops=1)

  • Buckets: 32768 (originally 4096) Batches: 1 (originally 1) Memory Usage: 2192kB
21. 7.262 19.669 ↓ 5.1 18,665 1

Nested Loop (cost=9.36..5,352.91 rows=3,695 width=68) (actual time=0.105..19.669 rows=18,665 loops=1)

22. 0.018 0.032 ↑ 1.0 45 1

Bitmap Heap Scan on territorio (cost=4.63..50.02 rows=45 width=40) (actual time=0.017..0.032 rows=45 loops=1)

  • Recheck Cond: (ter_nrutoperador = '76501303'::numeric)
  • Heap Blocks: exact=3
23. 0.014 0.014 ↑ 1.0 45 1

Bitmap Index Scan on idx_ter_extra (cost=0.00..4.62 rows=45 width=0) (actual time=0.013..0.014 rows=45 loops=1)

  • Index Cond: (ter_nrutoperador = '76501303'::numeric)
24. 9.090 12.375 ↓ 13.8 415 45

Bitmap Heap Scan on relacion_comer_localcliente (cost=4.73..117.54 rows=30 width=51) (actual time=0.087..0.275 rows=415 loops=45)

  • Recheck Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nidterritorio = territorio.ter_nidterritorio))
  • Heap Blocks: exact=6274
25. 3.285 3.285 ↓ 13.8 415 45

Bitmap Index Scan on idx_rco_operador_territorio (cost=0.00..4.72 rows=30 width=0) (actual time=0.073..0.073 rows=415 loops=45)

  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nidterritorio = territorio.ter_nidterritorio))
26. 124.840 124.840 ↓ 3.0 3 12,484

Index Scan using detalle_factura_pk on detalle_factura (cost=0.57..8.65 rows=1 width=41) (actual time=0.008..0.010 rows=3 loops=12,484)

  • Index Cond: ((dfa_nidfactura = factura.fac_nidfactura) AND (dfa_nrutoperador = '76501303'::numeric) AND ((dfa_scodrelacioncomercial)::text = (relacion_comer_l (...)
  • Filter: ((dfa_scodvariedad)::text = (CASE WHEN ((dfa_sindbonificado)::text = 'S'::text) THEN dfa_scodvariedadorigen ELSE dfa_scodvariedad END)::text)
27. 219.156 219.156 ↑ 1.0 1 36,526

Index Scan using idx1_articulo on articulo (cost=0.28..6.40 rows=1 width=50) (actual time=0.006..0.006 rows=1 loops=36,526)

  • Index Cond: (((art_scodformato)::text = (detalle_factura.dfa_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_factura.dfa_scodvariedad)::text) AND ((art (...)
28. 144.796 144.796 ↑ 1.0 1 36,199

Index Scan using pk_jerarquia_productobase on jerarquia_productobase (cost=0.28..6.15 rows=1 width=26) (actual time=0.004..0.004 rows=1 loops=36,199)

  • Index Cond: ((jpb_scodproductobase)::text = (articulo.art_scodjerproducbase)::text)
29. 398.189 723.980 ↑ 1.0 1 36,199

Hash Right Join (cost=4.18..5.98 rows=1 width=24) (actual time=0.009..0.020 rows=1 loops=36,199)

  • Hash Cond: ((jerarquia_categoria.jca_scodcategoria)::text = (jerarquia_agrupacion.jag_scodcategoria)::text)
30. 180.995 180.995 ↑ 1.0 57 36,199

Seq Scan on jerarquia_categoria (cost=0.00..1.57 rows=57 width=24) (actual time=0.001..0.005 rows=57 loops=36,199)

31. 36.199 144.796 ↑ 1.0 1 36,199

Hash (cost=4.17..4.17 rows=1 width=10) (actual time=0.004..0.004 rows=1 loops=36,199)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 108.597 108.597 ↑ 1.0 1 36,199

Index Scan using pk_jerarquia_agrupacion on jerarquia_agrupacion (cost=0.14..4.17 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=36,199)

  • Index Cond: ((jerarquia_productobase.jpb_scodagrupacion)::text = (jag_scodagrupacion)::text)
33. 36.199 36.199 ↑ 5.3 3 36,199

Seq Scan on jerarquia_linea (cost=0.00..1.16 rows=16 width=20) (actual time=0.001..0.001 rows=3 loops=36,199)

34. 2.065 126.872 ↓ 712.0 712 1

GroupAggregate (cost=22,548.64..22,548.77 rows=1 width=234) (actual time=124.788..126.872 rows=712 loops=1)

  • Group Key: jerarquia_linea_1.jli_sdeslinea, jerarquia_categoria_1.jca_sdescategoria, jerarquia_productobase_1.jpb_sdesproductobase, artunit.art_scodformato, artunit.art_scodvariedad, pack.art_sdescrip (...)
35. 4.662 124.807 ↓ 750.0 750 1

Sort (cost=22,548.64..22,548.64 rows=1 width=203) (actual time=124.745..124.807 rows=750 loops=1)

  • Sort Key: jerarquia_linea_1.jli_sdeslinea, jerarquia_categoria_1.jca_sdescategoria, jerarquia_productobase_1.jpb_sdesproductobase, artunit.art_scodformato, artunit.art_scodvariedad, pack.art_sde (...)
  • Sort Method: quicksort Memory: 224kB
36. 2.852 120.145 ↓ 750.0 750 1

Nested Loop (cost=469.62..22,548.63 rows=1 width=203) (actual time=4.377..120.145 rows=750 loops=1)

37. 7.148 115.043 ↓ 750.0 750 1

Nested Loop (cost=469.34..22,542.06 rows=1 width=168) (actual time=4.345..115.043 rows=750 loops=1)

  • Join Filter: ((detalle_factura_1.dfa_scodrelacioncomercial)::text = (relacion_comer_localcliente_1.rco_scodrelacioncomercial)::text)
  • Rows Removed by Join Filter: 891
  • -> Index Scan using relcomerclie_localclie_idx on relacion_comer_localcliente relacion_comer_localcliente_1 (cost=0.42..7.85 rows=1 width=51) (actual time=0.007..0.008 rows=2 loops (...)
38. 1.543 107.895 ↓ 750.0 750 1

Nested Loop Left Join (cost=468.91..22,534.19 rows=1 width=135) (actual time=4.317..107.895 rows=750 loops=1)

  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nrutcliente = factura_1.fac_nrutcliente) AND (rco_nnumlocal = factura_1.fac_nnumlocal))
39. 0.317 96.602 ↓ 750.0 750 1

Nested Loop Left Join (cost=466.71..22,530.74 rows=1 width=111) (actual time=4.276..96.602 rows=750 loops=1)

40. 3.773 94.035 ↓ 750.0 750 1

Nested Loop (cost=466.57..22,526.53 rows=1 width=111) (actual time=4.264..94.035 rows=750 loops=1)

  • -> Index Scan using pk_jerarquia_productobase on jerarquia_productobase jerarquia_productobase_1 (cost=0.28..6.15 rows=1 width=26) (actual time=0.004..0.004 rows= (...)
41. 2.809 90.262 ↓ 750.0 750 1

Nested Loop (cost=466.29..22,520.36 rows=1 width=95) (actual time=4.250..90.262 rows=750 loops=1)

  • Join Filter: ((precio_articulo.pra_dfhoiniciovigencia <= factura_1.fac_dfhocreacion) AND (precio_articulo.pra_dfhofinvigencia > factura_1.fac_dfhocreacion))
  • Rows Removed by Join Filter: 12833
  • Index Cond: ((jpb_scodproductobase)::text = (artunit.art_scodjerproducbase)::text)
42. 0.687 74.703 ↓ 750.0 750 1

Nested Loop (cost=466.00..22,513.87 rows=1 width=103) (actual time=4.205..74.703 rows=750 loops=1)

43. 0.625 69.516 ↓ 750.0 750 1

Nested Loop (cost=465.72..22,507.47 rows=1 width=83) (actual time=4.183..69.516 rows=750 loops=1)

44. 7.952 67.256 ↓ 327.0 327 1

Hash Join (cost=465.43..22,501.14 rows=1 width=78) (actual time=4.159..67.256 rows=327 loops=1)

  • Hash Cond: (((detalle_factura_1.dfa_scodformato)::text = (pack.art_scodformato)::text) AND ((CASE WHEN ((detalle_factura_1.dfa_sindbonificad (...)
45. 53.715 56.879 ↓ 56.0 36,526 1

Nested Loop (cost=39.07..22,071.28 rows=652 width=47) (actual time=1.185..56.879 rows=36,526 loops=1)

  • -> Index Scan using detalle_factura_pk on detalle_factura detalle_factura_1 (cost=0.57..20.22 rows=5 width=36) (actual time=0.007..0 (...)
46. 2.130 3.164 ↓ 4.7 4,256 1

Bitmap Heap Scan on factura factura_1 (cost=38.50..3,607.34 rows=911 width=34) (actual time=1.142..3.164 rows=4,256 loops=1)

  • Recheck Cond: ((fac_nrutoperador = '76501303'::numeric) AND (fac_dfhoemision >= to_date('01/12/2017'::character varying, 'dd/mm/ (...)
  • Heap Blocks: exact=728
  • Index Cond: ((dfa_nidfactura = factura_1.fac_nidfactura) AND (dfa_nrutoperador = '76501303'::numeric))
47. 1.034 1.034 ↓ 4.7 4,256 1

Bitmap Index Scan on idx_factura_idx02 (cost=0.00..38.27 rows=911 width=0) (actual time=1.034..1.034 rows=4,256 loops=1)

  • Index Cond: ((fac_nrutoperador = '76501303'::numeric) AND (fac_dfhoemision >= to_date('01/12/2017'::character varying, 'dd (...)
48. 0.611 2.425 ↑ 1.0 2,323 1

Hash (cost=391.51..391.51 rows=2,323 width=41) (actual time=2.425..2.425 rows=2,323 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 213kB
49. 1.695 1.814 ↑ 1.0 2,323 1

Bitmap Heap Scan on articulo pack (cost=48.48..391.51 rows=2,323 width=41) (actual time=0.148..1.814 rows=2,323 loops=1)

  • Recheck Cond: ((art_scodcomposicion)::text = 'PACKS'::text)
  • Heap Blocks: exact=232
50. 0.119 0.119 ↑ 1.0 2,323 1

Bitmap Index Scan on idx_extra_articulo (cost=0.00..47.90 rows=2,323 width=0) (actual time=0.119..0.119 rows=2,323 loops=1)

51. 1.635 1.635 ↓ 2.0 2 327

Index Scan using pk_detalle_pack on detalle_pack (cost=0.29..6.32 rows=1 width=19) (actual time=0.004..0.005 rows=2 loops=327)

  • Index Cond: ((dpk_scodformatopack = (pack.art_scodformato)::numeric) AND (dpk_scodvariedadpack = (pack.art_scodvariedad)::numeric))
52. 4.500 4.500 ↑ 1.0 1 750

Index Scan using idx1_articulo on articulo artunit (cost=0.28..6.39 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=750)

  • Index Cond: (((art_scodformato)::text = (detalle_pack.dpk_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_pack.dpk_scodvariedad)::tex (...)
53. 12.750 12.750 ↓ 18.0 18 750

Index Scan using precio_articulo_idx on precio_articulo (cost=0.29..6.48 rows=1 width=28) (actual time=0.007..0.017 rows=18 loops=750)

  • Index Cond: (((pra_scodformato)::text = (detalle_pack.dpk_scodformato)::text) AND ((pra_scodvariedad)::text = (detalle_pack.dpk_scodvariedad)::text))
54. 2.250 2.250 ↑ 1.0 1 750

Index Scan using pk_jerarquia_agrupacion on jerarquia_agrupacion jerarquia_agrupacion_1 (cost=0.14..4.17 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=750)

  • Index Cond: ((jerarquia_productobase_1.jpb_scodagrupacion)::text = (jag_scodagrupacion)::text)
55. 5.250 9.750 ↑ 1.0 1 750

Hash Right Join (cost=2.20..3.43 rows=1 width=34) (actual time=0.008..0.013 rows=1 loops=750)

  • Hash Cond: ((jerarquia_linea_1.jli_scodlinea)::text = (jerarquia_categoria_1.jca_scodlinea)::text)
56. 1.500 1.500 ↑ 1.0 16 750

Seq Scan on jerarquia_linea jerarquia_linea_1 (cost=0.00..1.16 rows=16 width=20) (actual time=0.001..0.002 rows=16 loops=750)

57. 3.000 3.000 ↑ 1.0 1 750

Hash (cost=2.19..2.19 rows=1 width=24) (actual time=0.004..0.004 rows=1 loops=750)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • -> Index Scan using pk_jerarquia_categoria on jerarquia_categoria jerarquia_categoria_1 (cost=0.14..2.19 rows=1 width=24) (actual time=0.003..0.003 rows=1 loops=7 (...)
  • Index Cond: ((jerarquia_agrupacion_1.jag_scodcategoria)::text = (jca_scodcategoria)::text)
58. 2.250 2.250 ↑ 1.0 1 750

Index Scan using idx_id_territorio on territorio territorio_1 (cost=0.28..6.28 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=750)

  • Index Cond: ((ter_nrutoperador = '76501303'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente_1.rco_nidterritorio))
59. 0.989 22.011 ↓ 489.0 489 1

GroupAggregate (cost=32.95..33.05 rows=1 width=234) (actual time=21.013..22.011 rows=489 loops=1)

  • Group Key: jerarquia_linea_2.jli_sdeslinea, jerarquia_categoria_2.jca_sdescategoria, jerarquia_productobase_2.jpb_sdesproductobase, articulo_1.art_scodformato, articulo_1.art_scodvariedad, relacion_co (...)
60. 2.313 21.022 ↓ 494.0 494 1

Sort (cost=32.95..32.95 rows=1 width=192) (actual time=20.984..21.022 rows=494 loops=1)

  • Sort Key: jerarquia_linea_2.jli_sdeslinea, jerarquia_categoria_2.jca_sdescategoria, jerarquia_productobase_2.jpb_sdesproductobase, articulo_1.art_scodformato, articulo_1.art_scodvariedad, relaci (...)
  • Sort Method: quicksort Memory: 156kB
61. 1.437 18.709 ↓ 494.0 494 1

Nested Loop Left Join (cost=2.52..32.94 rows=1 width=192) (actual time=0.262..18.709 rows=494 loops=1)

62. 0.513 16.284 ↓ 494.0 494 1

Nested Loop (cost=2.39..32.51 rows=1 width=164) (actual time=0.228..16.284 rows=494 loops=1)

63. 4.116 14.289 ↓ 494.0 494 1

Nested Loop (cost=2.11..32.20 rows=1 width=147) (actual time=0.212..14.289 rows=494 loops=1)

  • Join Filter: ((detalle_factura_recorrido.dfr_scodrelacioncomercial)::text = (relacion_comer_localcliente_2.rco_scodrelacioncomercial)::text)
  • Rows Removed by Join Filter: 593
  • -> Index Scan using idx_direc_relacioncomer on relacion_comer_localcliente relacion_comer_localcliente_2 (cost=0.42..8.45 rows=1 width=51) (actual time=0.006..0.007 rows=2 lo (...)
64. 0.556 10.173 ↓ 494.0 494 1

Nested Loop Left Join (cost=1.68..23.74 rows=1 width=114) (actual time=0.178..10.173 rows=494 loops=1)

  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nrutcliente = factura_recorrido.far_nrutcliente))
  • Filter: (factura_recorrido.far_nnumlocal = rco_nnumlocal)
  • Rows Removed by Filter: 0
65. 1.622 8.629 ↓ 494.0 494 1

Nested Loop Left Join (cost=1.54..23.51 rows=1 width=100) (actual time=0.156..8.629 rows=494 loops=1)

  • -> Index Scan using pk_jerarquia_agrupacion on jerarquia_agrupacion jerarquia_agrupacion_2 (cost=0.14..0.19 rows=1 width=10) (actual time=0.003..0.003 rows=1 loop (...)
66. 2.345 7.007 ↓ 494.0 494 1

Nested Loop (cost=1.40..23.32 rows=1 width=100) (actual time=0.143..7.007 rows=494 loops=1)

  • -> Index Scan using pk_jerarquia_productobase on jerarquia_productobase jerarquia_productobase_2 (cost=0.28..0.30 rows=1 width=26) (actual time=0.004..0.004 (...)
  • Index Cond: ((jerarquia_productobase_2.jpb_scodagrupacion)::text = (jag_scodagrupacion)::text)
67. 0.590 4.662 ↓ 494.0 494 1

Nested Loop (cost=1.12..23.02 rows=1 width=84) (actual time=0.116..4.662 rows=494 loops=1)

  • Index Cond: ((jpb_scodproductobase)::text = (articulo_1.art_scodjerproducbase)::text)
68. 0.984 1.108 ↓ 494.0 494 1

Nested Loop (cost=0.84..16.90 rows=1 width=44) (actual time=0.093..1.108 rows=494 loops=1)

  • -> Index Scan using detalle_factura_recorrido_pk on detalle_factura_recorrido (cost=0.42..8.45 rows=1 width=41) (actual time=0.008..0.015 rows=9 (...)
69. 0.124 0.124 ↓ 55.0 55 1

Index Scan using idx_factura_rec_idx02 on factura_recorrido (cost=0.42..8.45 rows=1 width=26) (actual time=0.059..0.124 rows=55 loops=1)

  • Index Cond: ((far_nrutoperador = '76501303'::numeric) AND (far_dfhoemision >= to_date('01/12/2017'::character varying, 'dd/mm/yyyy'::charact (...)
  • Index Cond: ((dfr_nidfactura = factura_recorrido.far_nidfactura) AND (dfr_nrutoperador = '76501303'::numeric))
  • Filter: ((dfr_scodvariedad)::text = (CASE WHEN ((dfr_sindbonificado)::text = 'S'::text) THEN dfr_scodvariedadorigen ELSE dfr_scodvariedad EN (...)
70. 2.964 2.964 ↑ 1.0 1 494

Index Scan using pk_articulo on articulo articulo_1 (cost=0.28..6.11 rows=1 width=50) (actual time=0.006..0.006 rows=1 loops=494)

  • Index Cond: (((art_scodformato)::text = (detalle_factura_recorrido.dfr_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_factura_recorr (...)
  • Filter: ((art_scodcomposicion)::text = 'UNITA'::text)
71. 0.988 0.988 ↑ 1.0 1 494

Index Scan using pk_jerarquia_categoria on jerarquia_categoria jerarquia_categoria_2 (cost=0.14..0.23 rows=1 width=24) (actual time=0.002..0.002 rows=1 loops=494)

  • Index Cond: ((jerarquia_agrupacion_2.jag_scodcategoria)::text = (jca_scodcategoria)::text)
72. 1.482 1.482 ↑ 1.0 1 494

Index Scan using idx_id_territorio on territorio territorio_2 (cost=0.28..0.31 rows=1 width=40) (actual time=0.003..0.003 rows=1 loops=494)

  • Index Cond: ((ter_nrutoperador = '76501303'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente_2.rco_nidterritorio))
73. 0.988 0.988 ↑ 1.0 1 494

Index Scan using idx_jli_extra on jerarquia_linea jerarquia_linea_2 (cost=0.14..0.36 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=494)

  • Index Cond: ((jerarquia_categoria_2.jca_scodlinea)::text = (jli_scodlinea)::text)
74. 0.001 3.457 ↓ 0.0 0 1

GroupAggregate (cost=28.67..28.81 rows=1 width=234) (actual time=3.457..3.457 rows=0 loops=1)

  • Group Key: jerarquia_linea_3.jli_sdeslinea, jerarquia_categoria_3.jca_sdescategoria, jerarquia_productobase_3.jpb_sdesproductobase, artunit_1.art_scodformato, artunit_1.art_scodvariedad, pack_1.art_sd (...)
75. 0.026 3.456 ↓ 0.0 0 1

Sort (cost=28.67..28.68 rows=1 width=203) (actual time=3.456..3.456 rows=0 loops=1)

  • Sort Key: jerarquia_linea_3.jli_sdeslinea, jerarquia_categoria_3.jca_sdescategoria, jerarquia_productobase_3.jpb_sdesproductobase, artunit_1.art_scodformato, artunit_1.art_scodvariedad, pack_1.a (...)
  • Sort Method: quicksort Memory: 25kB
76. 0.001 3.430 ↓ 0.0 0 1

Nested Loop Left Join (cost=3.39..28.66 rows=1 width=203) (actual time=3.430..3.430 rows=0 loops=1)

77. 0.001 3.429 ↓ 0.0 0 1

Nested Loop (cost=3.25..28.24 rows=1 width=175) (actual time=3.429..3.429 rows=0 loops=1)

78. 0.001 3.428 ↓ 0.0 0 1

Nested Loop (cost=2.97..27.93 rows=1 width=158) (actual time=3.428..3.428 rows=0 loops=1)

  • Join Filter: ((detalle_factura_recorrido_1.dfr_scodrelacioncomercial)::text = (relacion_comer_localcliente_3.rco_scodrelacioncomercial)::text)
79. 0.000 3.427 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.55..19.47 rows=1 width=125) (actual time=3.427..3.427 rows=0 loops=1)

80. 0.001 3.427 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.41..19.24 rows=1 width=111) (actual time=3.426..3.427 rows=0 loops=1)

81. 0.001 3.426 ↓ 0.0 0 1

Nested Loop (cost=2.26..19.05 rows=1 width=111) (actual time=3.426..3.426 rows=0 loops=1)

82. 0.000 3.425 ↓ 0.0 0 1

Nested Loop (cost=1.99..18.75 rows=1 width=95) (actual time=3.425..3.425 rows=0 loops=1)

  • Join Filter: (((detalle_pack_1.dpk_scodformato)::text = (artunit_1.art_scodformato)::text) AND ((detalle_pack_1.dpk_scodvariedad)::text = (artunit_1.art (...)
83. 0.001 3.425 ↓ 0.0 0 1

Nested Loop (cost=1.71..18.37 rows=1 width=87) (actual time=3.424..3.425 rows=0 loops=1)

  • Join Filter: ((precio_articulo_1.pra_dfhoiniciovigencia <= factura_recorrido_1.far_dfhocreacion) AND (precio_articulo_1.pra_dfhofinvigencia > fact (...)
84. 0.001 3.424 ↓ 0.0 0 1

Nested Loop (cost=1.42..17.79 rows=1 width=83) (actual time=3.424..3.424 rows=0 loops=1)

85. 0.264 3.423 ↓ 0.0 0 1

Nested Loop (cost=1.12..17.36 rows=1 width=78) (actual time=3.423..3.423 rows=0 loops=1)

86. 0.689 0.689 ↓ 494.0 494 1

Nested Loop (cost=0.84..16.90 rows=1 width=47) (actual time=0.068..0.689 rows=494 loops=1)

  • -> Index Scan using idx_factura_rec_idx02 on factura_recorrido factura_recorrido_1 (cost=0.42..8.45 rows=1 width=34) (actual t (...)
  • Index Cond: ((far_nrutoperador = '76501303'::numeric) AND (far_dfhoemision >= to_date('01/12/2017'::character varying, 'dd (...)
  • -> Index Scan using detalle_factura_recorrido_pk on detalle_factura_recorrido detalle_factura_recorrido_1 (cost=0.42..8.44 row (...)
  • Index Cond: ((dfr_nidfactura = factura_recorrido_1.far_nidfactura) AND (dfr_nrutoperador = '76501303'::numeric))
87. 2.470 2.470 ↓ 0.0 0 494

Index Scan using pk_articulo on articulo pack_1 (cost=0.29..0.47 rows=1 width=41) (actual time=0.005..0.005 rows=0 loops=494)

  • Index Cond: (((art_scodformato)::text = (detalle_factura_recorrido_1.dfr_scodformato)::text) AND ((art_scodvariedad)::text = (CA (...)
  • Filter: ((art_scodcomposicion)::text = 'PACKS'::text)
  • Rows Removed by Filter: 1
88. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_detalle_pack on detalle_pack detalle_pack_1 (cost=0.29..0.42 rows=1 width=19) (never executed)

  • Index Cond: ((dpk_scodformatopack = (pack_1.art_scodformato)::numeric) AND (dpk_scodvariedadpack = (pack_1.art_scodvariedad)::numeric) (...)
89. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_precio_articulo on precio_articulo precio_articulo_1 (cost=0.29..0.57 rows=1 width=28) (never executed)

  • Index Cond: (((pra_scodformato)::text = (detalle_pack_1.dpk_scodformato)::text) AND ((pra_scodvariedad)::text = (detalle_pack_1.dpk_scodvari (...)
90. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_articulo on articulo artunit_1 (cost=0.28..0.36 rows=1 width=20) (never executed)

  • Index Cond: (((art_scodformato)::text = (precio_articulo_1.pra_scodformato)::text) AND ((art_scodvariedad)::text = (precio_articulo_1.pra_scodvari (...)
91. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_jerarquia_productobase on jerarquia_productobase jerarquia_productobase_3 (cost=0.28..0.30 rows=1 width=26) (never executed)

  • Index Cond: ((jpb_scodproductobase)::text = (artunit_1.art_scodjerproducbase)::text)
92. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_jerarquia_agrupacion on jerarquia_agrupacion jerarquia_agrupacion_3 (cost=0.14..0.19 rows=1 width=10) (never executed)

  • Index Cond: ((jerarquia_productobase_3.jpb_scodagrupacion)::text = (jag_scodagrupacion)::text)
93. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_jerarquia_categoria on jerarquia_categoria jerarquia_categoria_3 (cost=0.14..0.23 rows=1 width=24) (never executed)

  • Index Cond: ((jerarquia_agrupacion_3.jag_scodcategoria)::text = (jca_scodcategoria)::text)
94. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_direc_relacioncomer on relacion_comer_localcliente relacion_comer_localcliente_3 (cost=0.42..8.45 rows=1 width=51) (never executed)

  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nrutcliente = factura_recorrido_1.far_nrutcliente))
  • Filter: (factura_recorrido_1.far_nnumlocal = rco_nnumlocal)
95. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_id_territorio on territorio territorio_3 (cost=0.28..0.31 rows=1 width=40) (never executed)

  • Index Cond: ((ter_nrutoperador = '76501303'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente_3.rco_nidterritorio))
96. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_jli_extra on jerarquia_linea jerarquia_linea_3 (cost=0.14..0.36 rows=1 width=20) (never executed)

  • Index Cond: ((jerarquia_categoria_3.jca_scodlinea)::text = (jli_scodlinea)::text)
97. 7.010 3,790.568 ↓ 3,249.0 3,249 1

GroupAggregate (cost=5,659.19..5,659.30 rows=1 width=234) (actual time=3,783.224..3,790.568 rows=3,249 loops=1)

  • Group Key: jerarquia_linea_4.jli_sdeslinea, jerarquia_categoria_4.jca_sdescategoria, jerarquia_productobase_4.jpb_sdesproductobase, articulo_2.art_scodformato, articulo_2.art_scodvariedad, relacion_co (...)
98. 24.619 3,783.558 ↓ 3,592.0 3,592 1

Sort (cost=5,659.19..5,659.19 rows=1 width=192) (actual time=3,783.197..3,783.558 rows=3,592 loops=1)

  • Sort Key: jerarquia_linea_4.jli_sdeslinea, jerarquia_categoria_4.jca_sdescategoria, jerarquia_productobase_4.jpb_sdesproductobase, articulo_2.art_scodformato, articulo_2.art_scodvariedad, relaci (...)
  • Sort Method: quicksort Memory: 1051kB
99. 15.577 3,758.939 ↓ 3,592.0 3,592 1

Nested Loop Semi Join (cost=2.40..5,659.18 rows=1 width=192) (actual time=0.740..3,758.939 rows=3,592 loops=1)

  • Join Filter: (nota_credito.ncr_nidnotacredito = factura_notacredito.fan_nidnotacredito)
100. 5.035 299.332 ↓ 4,502.0 4,502 1

Nested Loop Left Join (cost=1.98..5,429.03 rows=1 width=197) (actual time=0.194..299.332 rows=4,502 loops=1)

  • Join Filter: ((jerarquia_categoria_4.jca_scodlinea)::text = (jerarquia_linea_4.jli_scodlinea)::text)
  • Rows Removed by Join Filter: 6714
101. 10.159 289.795 ↓ 4,502.0 4,502 1

Nested Loop Left Join (cost=1.98..5,427.67 rows=1 width=187) (actual time=0.189..289.795 rows=4,502 loops=1)

  • Join Filter: ((jerarquia_agrupacion_4.jag_scodcategoria)::text = (jerarquia_categoria_4.jca_scodcategoria)::text)
  • Rows Removed by Join Filter: 44696
102. 29.020 270.632 ↓ 4,502.0 4,502 1

Nested Loop Left Join (cost=1.98..5,425.39 rows=1 width=173) (actual time=0.181..270.632 rows=4,502 loops=1)

  • Join Filter: ((jerarquia_productobase_4.jpb_scodagrupacion)::text = (jerarquia_agrupacion_4.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 191786
103. 48.724 223.604 ↓ 4,502.0 4,502 1

Nested Loop (cost=1.98..5,419.41 rows=1 width=173) (actual time=0.166..223.604 rows=4,502 loops=1)

  • Join Filter: ((articulo_2.art_scodjerproducbase)::text = (jerarquia_productobase_4.jpb_scodproductobase)::text)
  • Rows Removed by Join Filter: 341078
104. 3.885 143.366 ↓ 4,502.0 4,502 1

Nested Loop (cost=1.98..5,399.83 rows=1 width=157) (actual time=0.147..143.366 rows=4,502 loops=1)

105. 5.185 98.477 ↓ 4,556.0 4,556 1

Nested Loop (cost=1.69..5,396.55 rows=1 width=117) (actual time=0.123..98.477 rows=4,556 loops=1)

  • Join Filter: ((relacion_comer_localcliente_4.rco_scodrelacioncomercial)::text = (detalle_notacredito.dnc_scodrelacioncomercial)::text)
  • Rows Removed by Join Filter: 8834
106. 2.134 48.462 ↓ 498.1 4,483 1

Nested Loop (cost=1.14..5,319.29 rows=9 width=83) (actual time=0.080..48.462 rows=4,483 loops=1)

107. 28.376 28.376 ↓ 106.9 4,488 1

Nested Loop (cost=0.86..5,306.19 rows=42 width=66) (actual time=0.063..28.376 rows=4,488 loops=1)

  • -> Index Scan using idx_notacredito_consul on nota_credito (cost=0.43..2213.71 rows=377 width=26) (actual time=0.037..7.691 rows=1525 loop (...)
  • Index Cond: ((ncr_nrutoperador = '76501303'::numeric) AND (ncr_dfhoemision >= to_date('01/12/2017'::character varying, 'dd/mm/yyyy'::c (...)
  • Filter: ((ncr_scoddoctooriginal)::text = 'FACTU'::text)
  • -> Index Scan using relcomerclie_localclie_idx on relacion_comer_localcliente relacion_comer_localcliente_4 (cost=0.42..8.19 rows=1 width= (...)
  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nrutcliente = nota_credito.ncr_nrutcliente) AND (rco_nnumlocal = nota_c (...)
108. 17.952 17.952 ↑ 1.0 1 4,488

Index Scan using idx_id_territorio on territorio territorio_4 (cost=0.28..0.31 rows=1 width=40) (actual time=0.004..0.004 rows=1 loops=4,488)

  • Index Cond: ((ter_nrutoperador = '76501303'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente_4.rco_nidterritorio))
109. 44.830 44.830 ↓ 3.0 3 4,483

Index Scan using pk_detalle_notacredito on detalle_notacredito (cost=0.56..8.57 rows=1 width=41) (actual time=0.008..0.010 rows=3 loops=4,483)

  • Index Cond: ((dnc_nidnotacredito = nota_credito.ncr_nidnotacredito) AND (dnc_nrutoperador = '76501303'::numeric))
  • Filter: ((dnc_scodvariedad)::text = (CASE WHEN ((dnc_sindbonificado)::text = 'S'::text) THEN dnc_scodvariedadorigen ELSE dnc_scodvariedad END)::te (...)
110. 41.004 41.004 ↑ 1.0 1 4,556

Index Scan using pk_articulo on articulo articulo_2 (cost=0.28..3.28 rows=1 width=50) (actual time=0.009..0.009 rows=1 loops=4,556)

  • Index Cond: (((art_scodformato)::text = (detalle_notacredito.dnc_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_notacredito.dnc_scodvaried (...)
  • Filter: ((art_scodcomposicion)::text = 'UNITA'::text)
  • Rows Removed by Filter: 0
111. 31.514 31.514 ↑ 7.3 77 4,502

Seq Scan on jerarquia_productobase jerarquia_productobase_4 (cost=0.00..12.59 rows=559 width=26) (actual time=0.002..0.007 rows=77 loops=4,502)

112. 18.008 18.008 ↑ 4.0 44 4,502

Seq Scan on jerarquia_agrupacion jerarquia_agrupacion_4 (cost=0.00..3.77 rows=177 width=10) (actual time=0.002..0.004 rows=44 loops=4,502)

113. 9.004 9.004 ↑ 5.2 11 4,502

Seq Scan on jerarquia_categoria jerarquia_categoria_4 (cost=0.00..1.57 rows=57 width=24) (actual time=0.001..0.002 rows=11 loops=4,502)

114. 4.502 4.502 ↑ 8.0 2 4,502

Seq Scan on jerarquia_linea jerarquia_linea_4 (cost=0.00..1.16 rows=16 width=20) (actual time=0.001..0.001 rows=2 loops=4,502)

115. 3,444.030 3,444.030 ↑ 1.0 1 4,502

Index Only Scan using pk_factura_notacredito on factura_notacredito (cost=0.42..230.10 rows=1 width=15) (actual time=0.765..0.765 rows=1 loops=4,502)

  • Index Cond: ((fan_nrutoperador = '76501303'::numeric) AND (fan_nidnotacredito = detalle_notacredito.dnc_nidnotacredito))
  • Heap Fetches: 3592
116. 0.240 114.758 ↓ 75.0 75 1

GroupAggregate (cost=5,679.71..5,679.85 rows=1 width=234) (actual time=114.543..114.758 rows=75 loops=1)

  • Group Key: jerarquia_linea_5.jli_sdeslinea, jerarquia_categoria_5.jca_sdescategoria, jerarquia_productobase_5.jpb_sdesproductobase, artunit_2.art_scodformato, artunit_2.art_scodvariedad, relacion_come (...)
117. 0.335 114.518 ↓ 75.0 75 1

Sort (cost=5,679.71..5,679.72 rows=1 width=203) (actual time=114.514..114.518 rows=75 loops=1)

  • Sort Key: jerarquia_linea_5.jli_sdeslinea, jerarquia_categoria_5.jca_sdescategoria, jerarquia_productobase_5.jpb_sdesproductobase, artunit_2.art_scodformato, artunit_2.art_scodvariedad, relacion (...)
  • Sort Method: quicksort Memory: 44kB
118. 0.408 114.183 ↓ 75.0 75 1

Nested Loop Semi Join (cost=3.27..5,679.70 rows=1 width=203) (actual time=4.377..114.183 rows=75 loops=1)

  • Join Filter: (nota_credito_1.ncr_nidnotacredito = factura_notacredito_1.fan_nidnotacredito)
119. 0.145 53.595 ↓ 85.0 85 1

Nested Loop Left Join (cost=2.84..5,535.73 rows=1 width=208) (actual time=3.579..53.595 rows=85 loops=1)

  • Join Filter: ((jerarquia_categoria_5.jca_scodlinea)::text = (jerarquia_linea_5.jli_scodlinea)::text)
  • Rows Removed by Join Filter: 130
120. 0.127 53.365 ↓ 85.0 85 1

Nested Loop (cost=2.84..5,534.37 rows=1 width=198) (actual time=3.571..53.365 rows=85 loops=1)

121. 1.040 52.898 ↓ 85.0 85 1

Nested Loop (cost=2.56..5,534.06 rows=1 width=181) (actual time=3.558..52.898 rows=85 loops=1)

  • Join Filter: ((detalle_notacredito_1.dnc_scodrelacioncomercial)::text = (relacion_comer_localcliente_5.rco_scodrelacioncomercial)::text)
  • Rows Removed by Join Filter: 97
  • -> Index Scan using relcomerclie_localclie_idx on relacion_comer_localcliente relacion_comer_localcliente_5 (cost=0.42..8.19 rows=1 width=51) (actual time=0.009..0.010 (...)
122. 0.238 51.858 ↓ 85.0 85 1

Nested Loop Left Join (cost=2.14..5,525.85 rows=1 width=141) (actual time=3.532..51.858 rows=85 loops=1)

  • Join Filter: ((jerarquia_agrupacion_5.jag_scodcategoria)::text = (jerarquia_categoria_5.jca_scodcategoria)::text)
  • Rows Removed by Join Filter: 951
  • Index Cond: ((rco_nrutoperador = '76501303'::numeric) AND (rco_nrutcliente = nota_credito_1.ncr_nrutcliente) AND (rco_nnumlocal = nota_credito_1.ncr_nnumlocal))
123. 0.571 51.450 ↓ 85.0 85 1

Nested Loop Left Join (cost=2.14..5,523.57 rows=1 width=127) (actual time=3.522..51.450 rows=85 loops=1)

  • Join Filter: ((jerarquia_productobase_5.jpb_scodagrupacion)::text = (jerarquia_agrupacion_5.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 3952
124. 0.645 50.454 ↓ 85.0 85 1

Nested Loop (cost=2.14..5,517.59 rows=1 width=127) (actual time=3.507..50.454 rows=85 loops=1)

  • Join Filter: ((artunit_2.art_scodjerproducbase)::text = (jerarquia_productobase_5.jpb_scodproductobase)::text)
  • Rows Removed by Join Filter: 4029
125. 0.193 49.299 ↓ 85.0 85 1

Nested Loop (cost=2.14..5,498.01 rows=1 width=111) (actual time=3.486..49.299 rows=85 loops=1)

  • Join Filter: (((detalle_pack_2.dpk_scodformato)::text = (artunit_2.art_scodformato)::text) AND ((detalle_pack_2.dpk_scodvariedad)::text = (artunit (...)
126. 2.567 48.681 ↓ 85.0 85 1

Nested Loop (cost=1.85..5,497.64 rows=1 width=73) (actual time=3.474..48.681 rows=85 loops=1)

  • Join Filter: ((precio_articulo_2.pra_dfhoiniciovigencia <= nota_credito_1.ncr_dfhocreacion) AND (precio_articulo_2.pra_dfhofinvigencia > not (...)
  • Rows Removed by Join Filter: 1375
  • -> Index Scan using pk_precio_articulo on precio_articulo precio_articulo_2 (cost=0.29..0.57 rows=1 width=28) (actual time=0.009..0.026 ro (...)
127. 0.495 46.114 ↓ 85.0 85 1

Nested Loop (cost=1.57..5,497.05 rows=1 width=69) (actual time=3.438..46.114 rows=85 loops=1)

  • -> Index Scan using pk_detalle_pack on detalle_pack detalle_pack_2 (cost=0.29..0.42 rows=1 width=19) (actual time=0.006..0.006 rows= (...)
  • Index Cond: (((pra_scodformato)::text = (detalle_pack_2.dpk_scodformato)::text) AND ((pra_scodvariedad)::text = (detalle_pack_2.dpk_sc (...)
128. 25.631 45.619 ↓ 54.0 54 1

Nested Loop (cost=1.27..5,496.63 rows=1 width=64) (actual time=3.419..45.619 rows=54 loops=1)

  • -> Index Scan using pk_articulo on articulo pack_2 (cost=0.29..0.33 rows=1 width=11) (actual time=0.005..0.005 rows=0 loops=45 (...)
  • Index Cond: ((dpk_scodformatopack = (pack_2.art_scodformato)::numeric) AND (dpk_scodvariedadpack = (pack_2.art_scodvariedad)::nu (...)
129. 19.988 19.988 ↓ 30.4 4,556 1

Nested Loop (cost=0.99..5,447.20 rows=150 width=63) (actual time=0.091..19.988 rows=4,556 loops=1)

  • -> Index Scan using idx_notacredito_consul on nota_credito nota_credito_1 (cost=0.43..2213.71 rows=377 width=34) (actual (...)
  • Index Cond: ((ncr_nrutoperador = '76501303'::numeric) AND (ncr_dfhoemision >= to_date('01/12/2017'::character varyin (...)
  • Filter: ((ncr_scoddoctooriginal)::text = 'FACTU'::text)
  • -> Index Scan using pk_detalle_notacredito on detalle_notacredito detalle_notacredito_1 (cost=0.56..8.57 rows=1 width=36 (...)
  • Index Cond: ((dnc_nidnotacredito = nota_credito_1.ncr_nidnotacredito) AND (dnc_nrutoperador = '76501303'::numeric))
  • Index Cond: (((art_scodformato)::text = (detalle_notacredito_1.dnc_scodformato)::text) AND ((art_scodvariedad)::text = (CA (...)
  • Filter: ((art_scodcomposicion)::text = 'PACKS'::text)
  • Rows Removed by Filter: 1
130. 0.425 0.425 ↑ 1.0 1 85

Index Scan using pk_articulo on articulo artunit_2 (cost=0.28..0.36 rows=1 width=50) (actual time=0.005..0.005 rows=1 loops=85)

  • Index Cond: (((art_scodformato)::text = (precio_articulo_2.pra_scodformato)::text) AND ((art_scodvariedad)::text = (precio_articulo_2.pra_sc (...)
131. 0.510 0.510 ↑ 11.6 48 85

Seq Scan on jerarquia_productobase jerarquia_productobase_5 (cost=0.00..12.59 rows=559 width=26) (actual time=0.002..0.006 rows=48 loops=85)

132. 0.425 0.425 ↑ 3.8 47 85

Seq Scan on jerarquia_agrupacion jerarquia_agrupacion_5 (cost=0.00..3.77 rows=177 width=10) (actual time=0.002..0.005 rows=47 loops=85)

133. 0.170 0.170 ↑ 4.8 12 85

Seq Scan on jerarquia_categoria jerarquia_categoria_5 (cost=0.00..1.57 rows=57 width=24) (actual time=0.002..0.002 rows=12 loops=85)

134. 0.340 0.340 ↑ 1.0 1 85

Index Scan using idx_id_territorio on territorio territorio_5 (cost=0.28..0.31 rows=1 width=40) (actual time=0.004..0.004 rows=1 loops=85)

  • Index Cond: ((ter_nrutoperador = '76501303'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente_5.rco_nidterritorio))
135. 0.085 0.085 ↑ 5.3 3 85

Seq Scan on jerarquia_linea jerarquia_linea_5 (cost=0.00..1.16 rows=16 width=20) (actual time=0.001..0.001 rows=3 loops=85)

136. 60.180 60.180 ↑ 1.0 1 85

Index Only Scan using pk_factura_notacredito on factura_notacredito factura_notacredito_1 (cost=0.42..143.92 rows=1 width=15) (actual time=0.708..0.708 rows=1 loops=85)

  • Index Cond: ((fan_nrutoperador = '76501303'::numeric) AND (fan_nidnotacredito = detalle_notacredito_1.dnc_nidnotacredito))
  • Heap Fetches: 75
137. 153.145 153.145 ↑ 1.0 1 30,629

Index Scan using "idx$$_1c630004" on local_cliente (cost=0.42..8.44 rows=1 width=26) (actual time=0.005..0.005 rows=1 loops=30,629)

  • Index Cond: ((loc_nrutoperador = relacion_comer_localcliente.rco_nrutoperador) AND (loc_nrutcliente = relacion_comer_localcliente.rco_nrutcliente) AND (loc_nnumlocal = relacion_comer_localcliente.rco_nnumlocal))
138. 153.145 153.145 ↑ 1.0 1 30,629

Index Scan using pk_cliente on cliente (cost=0.42..0.53 rows=1 width=51) (actual time=0.005..0.005 rows=1 loops=30,629)

  • Index Cond: ((cli_nrutcliente = local_cliente.loc_nrutcliente) AND (cli_nrutoperador = local_cliente.loc_nrutoperador))
139. 61.258 61.258 ↑ 1.0 1 30,629

Index Scan using pk_categoria_negocio on categoria_negocio (cost=0.14..0.16 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=30,629)

  • Index Cond: ((can_scodcatnegocio)::text = (local_cliente.loc_scodcategorianegocio)::text)
140. 214.403 214.403 ↑ 1.0 1 30,629

Index Scan using pk_direccion_cliente_new on direccion_cliente diclegal (cost=0.42..0.55 rows=1 width=53) (actual time=0.007..0.007 rows=1 loops=30,629)

  • Index Cond: ((dic_niddireccion = local_cliente.loc_niddireccion) AND (dic_nrutoperador = local_cliente.loc_nrutoperador) AND (dic_nrutcliente = local_cliente.loc_nrutcliente))
Planning time : 88.019 ms
Execution time : 7,650.497 ms