explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qKPd

Settings
# exclusive inclusive rows x rows loops node
1. 0.044 462.293 ↓ 11.0 22 1

Sort (cost=5,447.88..5,447.88 rows=2 width=564) (actual time=462.292..462.293 rows=22 loops=1)

  • Sort Key: "*SELECT* 1".ped_nidpedido
  • Sort Method: quicksort Memory: 30kB
2. 0.007 462.249 ↓ 11.0 22 1

Append (cost=3,443.55..5,447.87 rows=2 width=564) (actual time=457.641..462.249 rows=22 loops=1)

3. 0.012 461.758 ↓ 22.0 22 1

Subquery Scan on *SELECT* 1 (cost=3,443.55..3,444.22 rows=1 width=324) (actual time=457.641..461.758 rows=22 loops=1)

4. 5.657 461.746 ↓ 22.0 22 1

GroupAggregate (cost=3,443.55..3,444.21 rows=1 width=334) (actual time=457.639..461.746 rows=22 loops=1)

  • Group Key: ped.ped_nidpedido, ((((cliente.cli_nrutcliente)::text || '-'::text) || (cliente.cli_sdigverificador)::text)), ped.ped_nrutoperador, territorio.ter_scodterritorio, zona.zon_sdeszona, cliente.cli_stipocluster, jerarquia_categor (...)
5. 0.177 456.089 ↓ 28.0 28 1

Sort (cost=3,443.55..3,443.56 rows=1 width=129) (actual time=456.086..456.089 rows=28 loops=1)

  • Sort Key: ped.ped_nidpedido, ((((cliente.cli_nrutcliente)::text || '-'::text) || (cliente.cli_sdigverificador)::text)), territorio.ter_scodterritorio, zona.zon_sdeszona, cliente.cli_stipocluster, jerarquia_categoria.jca_scodcatego (...)
  • Sort Method: quicksort Memory: 32kB
6. 0.189 455.912 ↓ 28.0 28 1

Nested Loop Anti Join (cost=13.22..3,443.54 rows=1 width=129) (actual time=36.274..455.912 rows=28 loops=1)

  • Join Filter: ((inversion_ctacorriente_mov.cmv_scodcategoria)::text = (jerarquia_categoria.jca_scodcategoria)::text)
7. 0.123 70.303 ↓ 28.0 28 1

Nested Loop (cost=12.80..1,949.57 rows=1 width=105) (actual time=21.034..70.303 rows=28 loops=1)

  • Join Filter: (((detalle_pedido.dpe_scodformato)::text = (precio_articulo.pra_scodformato)::text) AND ((detalle_pedido.dpe_scodvariedad)::text = (precio_articulo.pra_scodvariedad)::text))
8. 0.146 68.808 ↓ 28.0 28 1

Nested Loop (cost=12.52..1,949.02 rows=1 width=111) (actual time=20.994..68.808 rows=28 loops=1)

  • Join Filter: ((jerarquia_agrupacion.jag_scodcategoria)::text = (jerarquia_categoria.jca_scodcategoria)::text)
  • Rows Removed by Join Filter: 189
9. 0.310 68.466 ↓ 28.0 28 1

Nested Loop (cost=12.52..1,946.45 rows=1 width=97) (actual time=20.978..68.466 rows=28 loops=1)

  • Join Filter: ((jerarquia_productobase.jpb_scodagrupacion)::text = (jerarquia_agrupacion.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 1011
10. 0.094 68.016 ↓ 28.0 28 1

Nested Loop (cost=12.52..1,939.40 rows=1 width=97) (actual time=20.961..68.016 rows=28 loops=1)

11. 0.169 67.670 ↓ 28.0 28 1

Nested Loop (cost=12.24..1,939.10 rows=1 width=97) (actual time=20.942..67.670 rows=28 loops=1)

12. 0.164 67.137 ↓ 28.0 28 1

Nested Loop (cost=11.96..1,938.26 rows=1 width=81) (actual time=20.919..67.137 rows=28 loops=1)

  • Join Filter: (ped.ped_nrutcliente = cliente.cli_nrutcliente)
13. 0.086 66.609 ↓ 28.0 28 1

Nested Loop (cost=11.54..1,934.77 rows=1 width=83) (actual time=20.881..66.609 rows=28 loops=1)

14. 0.000 65.713 ↓ 45.0 45 1

Nested Loop (cost=10.98..1,926.18 rows=1 width=69) (actual time=8.763..65.713 rows=45 loops=1)

15. 1.795 13.607 ↓ 19.4 7,500 1

Nested Loop (cost=10.56..630.62 rows=386 width=54) (actual time=0.208..13.607 rows=7,500 loops=1)

16. 0.072 0.304 ↓ 7.0 28 1

Hash Join (cost=10.14..61.39 rows=4 width=48) (actual time=0.117..0.304 rows=28 loops=1)

  • Hash Cond: ((territorio.ter_scodzona)::text = (zona.zon_scodzona)::text)
17. 0.157 0.186 ↑ 1.5 28 1

Bitmap Heap Scan on territorio (cost=4.82..55.72 rows=43 width=25) (actual time=0.056..0.186 rows=28 loops=1)

  • Recheck Cond: (ter_nrutoperador = '76265773'::numeric)
  • Filter: (((ter_scodzona)::text >= ''::text) AND ((ter_scodzona)::text <= 'zzzzz'::text) AND ((ter_scodterritorio)::text >= ''::text) AND ((ter_scodterritorio) (...)
  • Rows Removed by Filter: 43
  • Heap Blocks: exact=11
18. 0.029 0.029 ↑ 1.0 71 1

Bitmap Index Scan on idx_ter_extra (cost=0.00..4.81 rows=71 width=0) (actual time=0.029..0.029 rows=71 loops=1)

  • Index Cond: (ter_nrutoperador = '76265773'::numeric)
19. 0.006 0.046 ↑ 1.0 8 1

Hash (cost=5.21..5.21 rows=8 width=33) (actual time=0.046..0.046 rows=8 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
20. 0.040 0.040 ↑ 1.0 8 1

Seq Scan on zona (cost=0.00..5.21 rows=8 width=33) (actual time=0.018..0.040 rows=8 loops=1)

  • Filter: (zon_nrutoperador = '76265773'::numeric)
  • Rows Removed by Filter: 170
21. 11.508 11.508 ↓ 7.7 268 28

Index Scan using idx_rco_operador_territorio on relacion_comer_localcliente (cost=0.42..141.96 rows=35 width=29) (actual time=0.028..0.411 rows=268 loops=28)

  • Index Cond: ((rco_nrutoperador = '76265773'::numeric) AND (rco_nidterritorio = territorio.ter_nidterritorio))
22. 52.500 52.500 ↓ 0.0 0 7,500

Index Scan using "idx$$_1c5d0001" on pedido ped (cost=0.42..3.35 rows=1 width=45) (actual time=0.007..0.007 rows=0 loops=7,500)

  • Index Cond: ((ped_nrutcliente = relacion_comer_localcliente.rco_nrutcliente) AND (ped_nrutoperador = '76265773'::numeric))
  • Filter: ((ped_dfhocreacion >= '2020-03-16 00:00:00'::timestamp without time zone) AND (ped_dfhocreacion <= '2020-03-19 23:59:59'::timestamp without time zone) AND ((ped_s (...)
  • Rows Removed by Filter: 1
23. 0.810 0.810 ↑ 1.0 1 45

Index Scan using pk_detalle_pedido on detalle_pedido (cost=0.55..8.57 rows=1 width=28) (actual time=0.015..0.018 rows=1 loops=45)

  • Index Cond: ((dpe_nidpedido = ped.ped_nidpedido) AND (dpe_nrutoperador = '76265773'::numeric))
  • Filter: (dpe_nporcdescuento > '0'::numeric)
  • Rows Removed by Filter: 10
24. 0.364 0.364 ↑ 1.0 1 28

Index Scan using pk_cliente on cliente (cost=0.42..3.48 rows=1 width=17) (actual time=0.013..0.013 rows=1 loops=28)

  • Index Cond: ((cli_nrutcliente = relacion_comer_localcliente.rco_nrutcliente) AND (cli_nrutoperador = '76265773'::numeric))
25. 0.364 0.364 ↑ 1.0 1 28

Index Scan using pk_articulo on articulo (cost=0.28..0.84 rows=1 width=16) (actual time=0.013..0.013 rows=1 loops=28)

  • Index Cond: (((art_scodformato)::text = (detalle_pedido.dpe_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_pedido.dpe_scodvariedad)::text))
26. 0.252 0.252 ↑ 1.0 1 28

Index Scan using pk_jerarquia_productobase on jerarquia_productobase (cost=0.28..0.30 rows=1 width=10) (actual time=0.009..0.009 rows=1 loops=28)

  • Index Cond: ((jpb_scodproductobase)::text = (articulo.art_scodjerproducbase)::text)
27. 0.140 0.140 ↑ 4.9 37 28

Seq Scan on jerarquia_agrupacion (cost=0.00..4.80 rows=180 width=10) (actual time=0.003..0.005 rows=37 loops=28)

28. 0.196 0.196 ↑ 7.1 8 28

Seq Scan on jerarquia_categoria (cost=0.00..1.85 rows=57 width=19) (actual time=0.004..0.007 rows=8 loops=28)

  • Filter: (((jca_scodcategoria)::text >= ''::text) AND ((jca_scodcategoria)::text <= 'zzzzz'::text))
  • Rows Removed by Filter: 1
29. 1.372 1.372 ↑ 1.0 1 28

Index Scan using precio_articulo_extra1 on precio_articulo (cost=0.29..0.54 rows=1 width=12) (actual time=0.043..0.049 rows=1 loops=28)

  • Index Cond: (((pra_scodformato)::text = (articulo.art_scodformato)::text) AND ((pra_scodvariedad)::text = (articulo.art_scodvariedad)::text))
  • Filter: ((pra_dfhoiniciovigencia <= sysdate) AND (pra_dfhofinvigencia > sysdate))
  • Rows Removed by Filter: 14
30. 385.420 385.420 ↓ 0.0 0 28

Index Scan using pk_inversion_mov on inversion_ctacorriente_mov (cost=0.42..1,493.95 rows=1 width=14) (actual time=13.765..13.765 rows=0 loops=28)

  • Index Cond: ((ped.ped_nidpedido = cmv_nidpedido) AND (cmv_nrutoperador = '76265773'::numeric))
31. 0.001 0.484 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=27.90..2,003.65 rows=1 width=267) (actual time=0.484..0.484 rows=0 loops=1)

32. 0.000 0.483 ↓ 0.0 0 1

Nested Loop (cost=27.90..2,003.64 rows=1 width=267) (actual time=0.483..0.483 rows=0 loops=1)

33. 0.001 0.483 ↓ 0.0 0 1

Nested Loop Left Join (cost=27.48..1,998.33 rows=1 width=124) (actual time=0.483..0.483 rows=0 loops=1)

34. 0.000 0.482 ↓ 0.0 0 1

Nested Loop Left Join (cost=26.92..1,989.75 rows=1 width=103) (actual time=0.482..0.482 rows=0 loops=1)

35. 0.001 0.482 ↓ 0.0 0 1

Nested Loop (cost=26.49..1,981.30 rows=1 width=81) (actual time=0.481..0.482 rows=0 loops=1)

  • Join Filter: ((inversion_ctacorriente_mov_1.cmv_scodcategoria)::text = (jerarquia_categoria_1.jca_scodcategoria)::text)
36. 0.000 0.481 ↓ 0.0 0 1

Nested Loop (cost=26.49..1,979.02 rows=1 width=67) (actual time=0.481..0.481 rows=0 loops=1)

37. 0.001 0.481 ↓ 0.0 0 1

Nested Loop (cost=26.35..1,978.49 rows=1 width=51) (actual time=0.481..0.481 rows=0 loops=1)

38. 0.397 0.480 ↓ 0.0 0 1

Bitmap Heap Scan on inversion_ctacorriente_mov inversion_ctacorriente_mov_1 (cost=26.07..1,973.13 rows=1 width=46) (actual time=0.480..0.480 rows=0 loops=1)

  • Recheck Cond: (cmv_nrutoperador = '76265773'::numeric)
  • Filter: (((cmv_scodestado)::text >= 'PENDIENTE'::text) AND ((cmv_scodestado)::text <= 'PENDIENTE'::text) AND ((cmv_scodestado)::text <> ALL ('{FACTU,NOCRE}'::text[])) AND (cmv_dfhomovimiento >= '2020- (...)
  • Rows Removed by Filter: 697
  • Heap Blocks: exact=99
39. 0.083 0.083 ↑ 1.1 697 1

Bitmap Index Scan on inversion_ctacorriente_mov_cmv_nrutoperador_idx (cost=0.00..26.07 rows=753 width=0) (actual time=0.083..0.083 rows=697 loops=1)

  • Index Cond: (cmv_nrutoperador = '76265773'::numeric)
40. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pk_territorio on territorio territorio_1 (cost=0.28..5.35 rows=1 width=17) (never executed)

  • Index Cond: ((ter_nrutoperador = '76265773'::numeric) AND (ter_scodzona >= ''::text) AND (ter_scodzona <= 'zzzzz'::text) AND (ter_scodterritorio = (inversion_ctacorriente_mov_1.cmv_scodterritorio)::te (...)
  • Heap Fetches: 0
41. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_zona on zona zona_1 (cost=0.14..0.52 rows=1 width=33) (never executed)

  • Index Cond: ((zon_nrutoperador = '76265773'::numeric) AND ((zon_scodzona)::text = (territorio_1.ter_scodzona)::text))
42. 0.000 0.000 ↓ 0.0 0

Seq Scan on jerarquia_categoria jerarquia_categoria_1 (cost=0.00..1.57 rows=57 width=19) (never executed)

43. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_pedido on pedido (cost=0.42..8.44 rows=1 width=37) (never executed)

  • Index Cond: ((inversion_ctacorriente_mov_1.cmv_nidpedido = ped_nidpedido) AND (inversion_ctacorriente_mov_1.cmv_nrutoperador = ped_nrutoperador) AND (ped_nrutoperador = '76265773'::numeric))
44. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_pedido_procesado on pedido_procesado (cost=0.56..8.58 rows=1 width=36) (never executed)

  • Index Cond: ((inversion_ctacorriente_mov_1.cmv_nidpedido = pep_nidpedido) AND (inversion_ctacorriente_mov_1.cmv_nrutoperador = pep_nrutoperador) AND (pep_nrutoperador = '76265773'::numeric))
45. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_cliente on cliente cliente_1 (cost=0.42..5.27 rows=1 width=17) (never executed)

  • Index Cond: ((cli_nrutcliente = nvl(pedido.ped_nrutcliente, pedido_procesado.pep_nrutcliente)) AND (cli_nrutoperador = '76265773'::numeric))
Planning time : 23.783 ms
Execution time : 463.027 ms