explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 33Sc

Settings
# exclusive inclusive rows x rows loops node
1. 0.975 55.364 ↓ 2.0 2 1

GroupAggregate (cost=3,561.38..3,562.04 rows=1 width=334) (actual time=55.156..55.364 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.326 0.399 ↑ 1.1 697 1

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

  • Recheck Cond: (cmv_nrutoperador = '76265773'::numeric)
  • Heap Blocks: exact=105
4. 0.073 0.073 ↑ 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.073..0.073 rows=697 loops=1)

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

Sort (cost=1,975.74..1,975.74 rows=1 width=129) (actual time=54.389..54.389 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.243 54.365 ↓ 2.0 2 1

Nested Loop Left Join (cost=12.80..1,975.73 rows=1 width=129) (actual time=32.323..54.365 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
7. 0.006 53.486 ↓ 2.0 2 1

Nested Loop (cost=12.80..1,949.57 rows=1 width=105) (actual time=31.612..53.486 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))
8. 0.006 53.378 ↓ 2.0 2 1

Nested Loop (cost=12.52..1,949.02 rows=1 width=111) (actual time=31.551..53.378 rows=2 loops=1)

  • Join Filter: ((jerarquia_agrupacion.jag_scodcategoria)::text = (jerarquia_categoria.jca_scodcategoria)::text)
  • Rows Removed by Join Filter: 12
9. 0.013 53.358 ↓ 2.0 2 1

Nested Loop (cost=12.52..1,946.45 rows=1 width=97) (actual time=31.538..53.358 rows=2 loops=1)

  • Join Filter: ((jerarquia_productobase.jpb_scodagrupacion)::text = (jerarquia_agrupacion.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 62
10. 0.004 53.331 ↓ 2.0 2 1

Nested Loop (cost=12.52..1,939.40 rows=1 width=97) (actual time=31.521..53.331 rows=2 loops=1)

11. 0.006 53.311 ↓ 2.0 2 1

Nested Loop (cost=12.24..1,939.10 rows=1 width=97) (actual time=31.507..53.311 rows=2 loops=1)

12. 0.007 53.283 ↓ 2.0 2 1

Nested Loop (cost=11.96..1,938.26 rows=1 width=81) (actual time=31.491..53.283 rows=2 loops=1)

  • Join Filter: (ped.ped_nrutcliente = cliente.cli_nrutcliente)
13. 0.005 53.258 ↓ 2.0 2 1

Nested Loop (cost=11.54..1,934.77 rows=1 width=83) (actual time=31.474..53.258 rows=2 loops=1)

14. 4.293 53.202 ↓ 3.0 3 1

Nested Loop (cost=10.98..1,926.18 rows=1 width=69) (actual time=29.525..53.202 rows=3 loops=1)

15. 1.589 11.409 ↓ 19.4 7,500 1

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

16. 0.032 0.216 ↓ 7.0 28 1

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

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

Bitmap Heap Scan on territorio (cost=4.82..55.72 rows=43 width=25) (actual time=0.050..0.141 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)::text <= 'zzzzz': (...)
  • Rows Removed by Filter: 43
  • Heap Blocks: exact=11
18. 0.024 0.024 ↑ 1.0 71 1

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

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

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

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

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

  • Filter: (zon_nrutoperador = '76265773'::numeric)
  • Rows Removed by Filter: 170
21. 9.604 9.604 ↓ 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.025..0.343 rows=268 loops=28)

  • Index Cond: ((rco_nrutoperador = '76265773'::numeric) AND (rco_nidterritorio = territorio.ter_nidterritorio))
22. 37.500 37.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.005..0.005 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_scodestado)::text = (...)
  • Rows Removed by Filter: 1
23. 0.051 0.051 ↑ 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.015..0.017 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
24. 0.018 0.018 ↑ 1.0 1 2

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

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

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

  • Index Cond: (((art_scodformato)::text = (detalle_pedido.dpe_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_pedido.dpe_scodvariedad)::text))
26. 0.016 0.016 ↑ 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.008..0.008 rows=1 loops=2)

  • Index Cond: ((jpb_scodproductobase)::text = (articulo.art_scodjerproducbase)::text)
27. 0.014 0.014 ↑ 5.6 32 2

Seq Scan on jerarquia_agrupacion (cost=0.00..4.80 rows=180 width=10) (actual time=0.005..0.007 rows=32 loops=2)

28. 0.014 0.014 ↑ 8.1 7 2

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

  • Filter: (((jca_scodcategoria)::text >= ''::text) AND ((jca_scodcategoria)::text <= 'zzzzz'::text))
  • Rows Removed by Filter: 1
29. 0.102 0.102 ↑ 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.048..0.051 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
30. 0.636 0.636 ↑ 1.1 697 2

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

Planning time : 18.421 ms
Execution time : 55.654 ms