explain.depesz.com

PostgreSQL's explain analyze made readable

Result: okFF : Optimization for: plan #JyUw

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.022 0.316 ↓ 0.0 0 1

Sort (cost=89.54..89.55 rows=7 width=192) (actual time=0.316..0.316 rows=0 loops=1)

  • Sort Key: (COALESCE((SubPlan 1), '0'::numeric)) DESC, cmo.cmo_id DESC, (CASE WHEN (clor.co1_orden IS NULL) THEN 1 ELSE clor.co1_orden END), pro.pro_nombre
  • Sort Method: quicksort Memory: 25kB
2. 0.000 0.294 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.71..89.44 rows=7 width=192) (actual time=0.294..0.294 rows=0 loops=1)

3. 0.000 0.294 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.56..52.77 rows=7 width=156) (actual time=0.294..0.294 rows=0 loops=1)

4. 0.000 0.294 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.28..50.48 rows=7 width=152) (actual time=0.294..0.294 rows=0 loops=1)

5. 0.001 0.294 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.14..49.30 rows=7 width=150) (actual time=0.294..0.294 rows=0 loops=1)

6. 0.016 0.293 ↓ 0.0 0 1

Nested Loop (cost=1.86..47.13 rows=7 width=68) (actual time=0.293..0.293 rows=0 loops=1)

7. 0.005 0.097 ↑ 1.0 9 1

Nested Loop (cost=1.57..21.50 rows=9 width=72) (actual time=0.082..0.097 rows=9 loops=1)

8. 0.001 0.075 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.15..20.42 rows=1 width=56) (actual time=0.071..0.075 rows=1 loops=1)

9. 0.011 0.066 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.86..20.09 rows=1 width=32) (actual time=0.063..0.066 rows=1 loops=1)

10. 0.008 0.048 ↑ 1.0 1 1

Nested Loop (cost=0.58..17.58 rows=1 width=16) (actual time=0.046..0.048 rows=1 loops=1)

11. 0.031 0.031 ↑ 1.0 1 1

Index Scan using cfactura_pkey on cfactura cfa (cost=0.29..15.06 rows=1 width=12) (actual time=0.030..0.031 rows=1 loops=1)

  • Index Cond: (cfa_id = ANY (('{" 35111"}'::text[])::integer[]))
12. 0.009 0.009 ↑ 1.0 1 1

Index Only Scan using cfacnen_uk_facnotaent on cfacnen nen (cost=0.29..2.51 rows=1 width=8) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (cfa_id = cfa.cfa_id)
  • Heap Fetches: 1
13. 0.007 0.007 ↑ 1.0 1 1

Index Only Scan using idx_clu_cliente on cliente cli (cost=0.28..2.50 rows=1 width=20) (actual time=0.006..0.007 rows=1 loops=1)

  • Index Cond: (cli_id = cfa.cli_id)
  • Heap Fetches: 1
14. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pk_entidad on entidad ent (cost=0.28..0.32 rows=1 width=32) (actual time=0.007..0.008 rows=1 loops=1)

  • Index Cond: (ent_id = cli.ent_id)
15. 0.017 0.017 ↑ 2.0 9 1

Index Scan using dmovinv_llave_cabecera on dmovinv dmo (cost=0.42..0.91 rows=18 width=16) (actual time=0.009..0.017 rows=9 loops=1)

  • Index Cond: (cmo_id = nen.cmo_id)
16. 0.072 0.180 ↓ 0.0 0 9

Index Only Scan using cmovinv_pkey on cmovinv cmo (cost=0.29..2.84 rows=1 width=4) (actual time=0.020..0.020 rows=0 loops=9)

  • Index Cond: (cmo_id = dmo.cmo_id)
  • Filter: (COALESCE((SubPlan 3), '0'::numeric) <> dmo.dmo_cantidad)
  • Rows Removed by Filter: 1
  • Heap Fetches: 9
17.          

SubPlan (forIndex Only Scan)

18. 0.054 0.108 ↑ 1.0 1 9

Aggregate (cost=2.51..2.52 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=9)

19. 0.054 0.054 ↓ 4.0 4 9

Index Scan using idx_dfactura_despacho_cmoid_proid on dfactura_despacho dd_2 (cost=0.29..2.51 rows=1 width=5) (actual time=0.005..0.006 rows=4 loops=9)

  • Index Cond: ((cmo_id = cmo.cmo_id) AND (pro_id = dmo.pro_id))
20. 0.000 0.000 ↓ 0.0 0

Index Scan using producto_pkey on producto pro (cost=0.28..0.30 rows=1 width=82) (never executed)

  • Index Cond: (pro_id = dmo.pro_id)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using marca_pkey on marca mar (cost=0.14..0.16 rows=1 width=10) (never executed)

  • Index Cond: (mar_id = pro.mar_id)
22. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_producto1_producto on producto1 pro1 (cost=0.28..0.32 rows=1 width=8) (never executed)

  • Index Cond: (pro_id = pro.pro_id)
23. 0.000 0.000 ↓ 0.0 0

Index Scan using uk_clasificacion1_orden on clasificacion1_orden clor (cost=0.14..0.16 rows=1 width=8) (never executed)

  • Index Cond: (cla1_id = pro.cla1_id)
24.          

SubPlan (forNested Loop Left Join)

25. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2.51..2.52 rows=1 width=32) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_dfactura_despacho_cmoid_proid on dfactura_despacho dd (cost=0.29..2.51 rows=1 width=5) (never executed)

  • Index Cond: ((cmo_id = cmo.cmo_id) AND (pro_id = dmo.pro_id))
27. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=2.51..2.52 rows=1 width=32) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_dfactura_despacho_cmoid_proid on dfactura_despacho dd_1 (cost=0.29..2.51 rows=1 width=5) (never executed)

  • Index Cond: ((cmo_id = cmo.cmo_id) AND (pro_id = dmo.pro_id))