explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CoRH

Settings
# exclusive inclusive rows x rows loops node
1. 8.398 17.390 ↓ 2.0 2 1

GroupAggregate (cost=4,236.93..4,237.59 rows=1 width=334) (actual time=16.402..17.390 rows=2 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_categoria.jca_scodcategor (...)
2.          

CTE cw

3. 0.995 1.106 ↑ 1.1 697 1

Bitmap Heap Scan on inversion_ctacorriente_mov (cost=18.21..1,585.64 rows=747 width=14) (actual time=0.139..1.106 rows=697 loops=1)

  • Recheck Cond: (cmv_nrutoperador = '76265773'::numeric)
  • Heap Blocks: exact=105
4. 0.111 0.111 ↑ 1.1 697 1

Bitmap Index Scan on inversion_ctacorriente_mov_cmv_nrutoperador_idx (cost=0.00..18.02 rows=747 width=0) (actual time=0.111..0.111 rows=697 loops=1)

  • Index Cond: (cmv_nrutoperador = '76265773'::numeric)
5. 0.076 8.992 ↓ 2.0 2 1

Sort (cost=2,651.29..2,651.29 rows=1 width=129) (actual time=8.991..8.992 rows=2 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_scodcategoria
  • Sort Method: quicksort Memory: 25kB
6. 0.015 8.916 ↓ 2.0 2 1

Nested Loop (cost=58.33..2,651.28 rows=1 width=129) (actual time=8.383..8.916 rows=2 loops=1)

7. 0.007 8.867 ↓ 2.0 2 1

Nested Loop (cost=58.19..2,650.56 rows=1 width=89) (actual time=8.341..8.867 rows=2 loops=1)

8. 0.021 8.804 ↓ 2.0 2 1

Nested Loop (cost=57.91..2,650.23 rows=1 width=94) (actual time=8.285..8.804 rows=2 loops=1)

  • Join Filter: ((ped.ped_nrutcliente = relacion_comer_localcliente.rco_nrutcliente) AND (ped.ped_nnumlocal = relacion_comer_localcliente.rco_nnumlocal) AND ((ped.ped_scodrelacioncomer)::text = (relacion_comer_localcliente.rco_scodre (...)
  • Rows Removed by Join Filter: 4
9. 0.274 8.697 ↓ 2.0 2 1

Nested Loop Left Join (cost=57.48..2,645.48 rows=1 width=93) (actual time=8.190..8.697 rows=2 loops=1)

  • Join Filter: ((ped.ped_nidpedido = cw.cmv_nidpedido) AND ((cw.cmv_scodcategoria)::text = (jerarquia_categoria.jca_scodcategoria)::text))
  • Rows Removed by Join Filter: 1394
10. 0.011 7.029 ↓ 2.0 2 1

Nested Loop (cost=57.48..2,619.33 rows=1 width=93) (actual time=6.716..7.029 rows=2 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))
11. 0.017 6.660 ↓ 2.0 2 1

Nested Loop (cost=57.20..2,618.78 rows=1 width=99) (actual time=6.528..6.660 rows=2 loops=1)

12. 0.038 6.617 ↓ 2.0 2 1

Nested Loop (cost=57.06..2,618.55 rows=1 width=85) (actual time=6.494..6.617 rows=2 loops=1)

  • Join Filter: ((jerarquia_productobase.jpb_scodagrupacion)::text = (jerarquia_agrupacion.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 358
13. 0.099 0.099 ↑ 1.0 180 1

Index Scan using idx_jerarquia_agrupacion on jerarquia_agrupacion (cost=0.14..22.84 rows=180 width=10) (actual time=0.025..0.099 rows=180 loops=1)

14. 0.109 6.480 ↓ 2.0 2 180

Materialize (cost=56.91..2,593.01 rows=1 width=85) (actual time=0.008..0.036 rows=2 loops=180)

15. 0.005 6.371 ↓ 2.0 2 1

Nested Loop (cost=56.91..2,593.00 rows=1 width=85) (actual time=1.498..6.371 rows=2 loops=1)

16. 0.008 6.342 ↓ 2.0 2 1

Nested Loop (cost=56.64..2,592.70 rows=1 width=85) (actual time=1.475..6.342 rows=2 loops=1)

17. 0.004 6.262 ↓ 2.0 2 1

Nested Loop (cost=56.35..2,591.86 rows=1 width=69) (actual time=1.420..6.262 rows=2 loops=1)

18. 0.011 6.194 ↓ 2.0 2 1

Nested Loop (cost=55.93..2,583.42 rows=1 width=59) (actual time=1.359..6.194 rows=2 loops=1)

19. 5.637 6.060 ↑ 23.7 3 1

Bitmap Heap Scan on pedido ped (cost=55.38..1,973.88 rows=71 width=45) (actual time=1.310..6.060 rows=3 loops=1)

  • Recheck Cond: ((ped_nrutoperador = '76265773'::numeric) AND (ped_dfhocreacion >= '2020-03-16 00:00:00'::timestamp without time zone) AND (ped_dfhocreacion <= '2020-03-19 (...)
  • Filter: ((ped_scodestado)::text = 'CREAD'::text)
  • Rows Removed by Filter: 1392
  • Heap Blocks: exact=633
20. 0.423 0.423 ↓ 2.6 1,427 1

Bitmap Index Scan on pedido_fecha (cost=0.00..55.36 rows=555 width=0) (actual time=0.423..0.423 rows=1,427 loops=1)

  • Index Cond: ((ped_nrutoperador = '76265773'::numeric) AND (ped_dfhocreacion >= '2020-03-16 00:00:00'::timestamp without time zone) AND (ped_dfhocreacion <= '2020-03 (...)
21. 0.123 0.123 ↑ 1.0 1 3

Index Scan using pk_detalle_pedido on detalle_pedido (cost=0.55..8.57 rows=1 width=28) (actual time=0.036..0.041 rows=1 loops=3)

  • Index Cond: ((dpe_nidpedido = ped.ped_nidpedido) AND (dpe_nrutoperador = '76265773'::numeric))
  • Filter: (dpe_nporcdescuento > '0'::numeric)
  • Rows Removed by Filter: 8
22. 0.064 0.064 ↑ 1.0 1 2

Index Scan using "idx$$_1c630002" on cliente (cost=0.42..8.44 rows=1 width=17) (actual time=0.032..0.032 rows=1 loops=2)

  • Index Cond: ((cli_nrutoperador = '76265773'::numeric) AND (cli_nrutcliente = ped.ped_nrutcliente))
23. 0.072 0.072 ↑ 1.0 1 2

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

  • Index Cond: (((art_scodformato)::text = (detalle_pedido.dpe_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_pedido.dpe_scodvariedad)::text))
24. 0.024 0.024 ↑ 1.0 1 2

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

  • Index Cond: ((jpb_scodproductobase)::text = (articulo.art_scodjerproducbase)::text)
25. 0.026 0.026 ↑ 1.0 1 2

Index Scan using pk_jerarquia_categoria on jerarquia_categoria (cost=0.14..0.23 rows=1 width=19) (actual time=0.013..0.013 rows=1 loops=2)

  • Index Cond: (((jca_scodcategoria)::text = (jerarquia_agrupacion.jag_scodcategoria)::text) AND ((jca_scodcategoria)::text >= ''::text) AND ((jca_scodcategoria)::text <= 'zzzzz'::text))
26. 0.358 0.358 ↑ 1.0 1 2

Index Scan using precio_articulo_extra1 on precio_articulo (cost=0.29..0.54 rows=1 width=12) (actual time=0.166..0.179 rows=1 loops=2)

  • 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: 20
27. 1.394 1.394 ↑ 1.1 697 2

CTE Scan on cw (cost=0.00..14.94 rows=747 width=40) (actual time=0.071..0.697 rows=697 loops=2)

28. 0.086 0.086 ↓ 3.0 3 2

Index Scan using pk_relacion_comer_localcliente on relacion_comer_localcliente (cost=0.42..4.74 rows=1 width=29) (actual time=0.032..0.043 rows=3 loops=2)

  • Index Cond: ((rco_nrutcliente = cliente.cli_nrutcliente) AND (rco_nrutoperador = '76265773'::numeric))
29. 0.056 0.056 ↑ 1.0 1 2

Index Scan using idx_id_territorio on territorio (cost=0.28..0.32 rows=1 width=25) (actual time=0.028..0.028 rows=1 loops=2)

  • Index Cond: ((ter_nrutoperador = '76265773'::numeric) AND (ter_nidterritorio = relacion_comer_localcliente.rco_nidterritorio))
  • Filter: (((ter_scodzona)::text >= ''::text) AND ((ter_scodzona)::text <= 'zzzzz'::text) AND ((ter_scodterritorio)::text >= ''::text) AND ((ter_scodterritorio)::text <= 'zzzzz'::text) AND ((ter_scodestado)::text = 'VIGEN'::text))
30. 0.034 0.034 ↑ 1.0 1 2

Index Scan using pk_zona on zona (cost=0.14..0.70 rows=1 width=33) (actual time=0.016..0.017 rows=1 loops=2)

  • Index Cond: ((zon_nrutoperador = '76265773'::numeric) AND ((zon_scodzona)::text = (territorio.ter_scodzona)::text))
Planning time : 21.795 ms
Execution time : 18.066 ms