explain.depesz.com

PostgreSQL's explain analyze made readable

Result: dDN6

Settings
# exclusive inclusive rows x rows loops node
1. 4.934 14.139 ↓ 2.0 2 1

GroupAggregate (cost=2,624.43..2,625.09 rows=1 width=313) (actual time=13.563..14.139 rows=2 loops=1)

  • Group Key: ped.ped_nidpedido, ((((cliente.cli_nrutcliente)::text || '-'::text) || (cliente.cli_sdigverificador)::text)), ped.ped_nrutoperador, territorio.ter_scodterritorio, cliente.cli_stipocluster, jerarquia_categoria.jca_scodcategoria
2. 0.052 9.205 ↓ 2.0 2 1

Sort (cost=2,624.43..2,624.44 rows=1 width=108) (actual time=9.205..9.205 rows=2 loops=1)

  • Sort Key: ped.ped_nidpedido, ((((cliente.cli_nrutcliente)::text || '-'::text) || (cliente.cli_sdigverificador)::text)), territorio.ter_scodterritorio, cliente.cli_stipocluster, jerarquia_categoria.jca_scodcategoria
  • Sort Method: quicksort Memory: 25kB
3. 0.010 9.153 ↓ 2.0 2 1

Nested Loop (cost=58.19..2,624.42 rows=1 width=108) (actual time=8.898..9.153 rows=2 loops=1)

4. 0.009 9.101 ↓ 2.0 2 1

Nested Loop (cost=57.91..2,624.09 rows=1 width=94) (actual time=8.858..9.101 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_scodrelacion (...)
  • Rows Removed by Join Filter: 4
5. 0.006 9.018 ↓ 2.0 2 1

Nested Loop (cost=57.48..2,619.33 rows=1 width=93) (actual time=8.784..9.018 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))
6. 0.008 8.744 ↓ 2.0 2 1

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

7. 0.073 8.724 ↓ 2.0 2 1

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

  • Join Filter: ((jerarquia_productobase.jpb_scodagrupacion)::text = (jerarquia_agrupacion.jag_scodagrupacion)::text)
  • Rows Removed by Join Filter: 358
8. 0.551 0.551 ↑ 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.493..0.551 rows=180 loops=1)

9. 0.059 8.100 ↓ 2.0 2 180

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

10. 0.004 8.041 ↓ 2.0 2 1

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

11. 0.005 8.023 ↓ 2.0 2 1

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

12. 0.004 7.966 ↓ 2.0 2 1

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

13. 0.008 7.906 ↓ 2.0 2 1

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

14. 4.698 7.802 ↑ 23.7 3 1

Bitmap Heap Scan on pedido ped (cost=55.38..1,973.88 rows=71 width=45) (actual time=3.823..7.802 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 23:59:59'::t (...)
  • Filter: ((ped_scodestado)::text = 'CREAD'::text)
  • Rows Removed by Filter: 1,392
  • Heap Blocks: exact=633
15. 3.104 3.104 ↓ 2.6 1,427 1

Bitmap Index Scan on pedido_fecha (cost=0.00..55.36 rows=555 width=0) (actual time=3.104..3.104 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-19 23:59:59 (...)
16. 0.096 0.096 ↑ 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.027..0.032 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
17. 0.056 0.056 ↑ 1.0 1 2

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

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

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

  • Index Cond: (((art_scodformato)::text = (detalle_pedido.dpe_scodformato)::text) AND ((art_scodvariedad)::text = (detalle_pedido.dpe_scodvariedad)::text))
19. 0.014 0.014 ↑ 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.007..0.007 rows=1 loops=2)

  • Index Cond: ((jpb_scodproductobase)::text = (articulo.art_scodjerproducbase)::text)
20. 0.012 0.012 ↑ 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.006..0.006 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))
21. 0.268 0.268 ↑ 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.127..0.134 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
22. 0.074 0.074 ↓ 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.028..0.037 rows=3 loops=2)

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

Index Scan using idx_id_territorio on territorio (cost=0.28..0.32 rows=1 width=20) (actual time=0.021..0.021 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))
Planning time : 12.985 ms
Execution time : 14.537 ms