explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UwGM

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 0.222 ↓ 0.0 0 1

Sort (cost=80.60..80.61 rows=6 width=192) (actual time=0.222..0.222 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.001 0.209 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.71..80.52 rows=6 width=192) (actual time=0.209..0.209 rows=0 loops=1)

3. 0.001 0.208 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.56..49.09 rows=6 width=156) (actual time=0.208..0.208 rows=0 loops=1)

4. 0.000 0.207 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.28..47.13 rows=6 width=152) (actual time=0.207..0.207 rows=0 loops=1)

5. 0.000 0.207 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.14..46.12 rows=6 width=150) (actual time=0.207..0.207 rows=0 loops=1)

6. 0.003 0.207 ↓ 0.0 0 1

Nested Loop (cost=1.86..44.26 rows=6 width=68) (actual time=0.207..0.207 rows=0 loops=1)

7. 0.002 0.096 ↓ 1.1 9 1

Nested Loop (cost=1.57..21.48 rows=8 width=72) (actual time=0.084..0.096 rows=9 loops=1)

8. 0.002 0.071 ↑ 1.0 1 1

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

9. 0.009 0.066 ↑ 1.0 1 1

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

10. 0.005 0.052 ↑ 1.0 1 1

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

11. 0.033 0.033 ↑ 1.0 1 1

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

  • Index Cond: (cfa_id = ANY (('{" 35111"}'::text[])::integer[]))
12. 0.014 0.014 ↑ 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.014..0.014 rows=1 loops=1)

  • Index Cond: (cfa_id = cfa.cfa_id)
  • Heap Fetches: 1
13. 0.005 0.005 ↑ 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.004..0.005 rows=1 loops=1)

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

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

  • Index Cond: (ent_id = cli.ent_id)
15. 0.023 0.023 ↑ 1.9 9 1

Index Scan using dmovinv_llave_cabecera on dmovinv dmo (cost=0.42..0.89 rows=17 width=16) (actual time=0.015..0.023 rows=9 loops=1)

  • Index Cond: (cmo_id = nen.cmo_id)
16. 0.045 0.108 ↓ 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.012..0.012 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.036 0.063 ↑ 1.0 1 9

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

19. 0.027 0.027 ↓ 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.003..0.003 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))