explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bG53

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 0.149 ↓ 0.0 0 1

Sort (cost=89.54..89.56 rows=7 width=192) (actual time=0.149..0.149 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.129 ↓ 0.0 0 1

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

3. 0.000 0.129 ↓ 0.0 0 1

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

4. 0.000 0.129 ↓ 0.0 0 1

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

5. 0.001 0.129 ↓ 0.0 0 1

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

6. 0.005 0.128 ↓ 0.0 0 1

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

7. 0.001 0.071 ↑ 4.5 2 1

Nested Loop (cost=1.57..21.50 rows=9 width=72) (actual time=0.067..0.071 rows=2 loops=1)

8. 0.001 0.058 ↑ 1.0 1 1

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

9. 0.008 0.053 ↑ 1.0 1 1

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

10. 0.006 0.040 ↑ 1.0 1 1

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

11. 0.027 0.027 ↑ 1.0 1 1

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

  • Index Cond: (cfa_id = ANY (('{" 35109"}'::text[])::integer[]))
12. 0.007 0.007 ↑ 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.007..0.007 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.004 0.004 ↑ 1.0 1 1

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

  • Index Cond: (ent_id = cli.ent_id)
15. 0.012 0.012 ↑ 9.0 2 1

Index Scan using dmovinv_llave_cabecera on dmovinv dmo (cost=0.42..0.91 rows=18 width=16) (actual time=0.011..0.012 rows=2 loops=1)

  • Index Cond: (cmo_id = nen.cmo_id)
16. 0.018 0.052 ↓ 0.0 0 2

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

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

SubPlan (forIndex Only Scan)

18. 0.016 0.034 ↑ 1.0 1 2

Aggregate (cost=2.51..2.52 rows=1 width=32) (actual time=0.017..0.017 rows=1 loops=2)

19. 0.018 0.018 ↓ 4.0 4 2

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.007..0.009 rows=4 loops=2)

  • 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))