explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hb3f

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 1.031 ↑ 1.1 21 1

Subquery Scan on detalles (cost=622.24..622.53 rows=23 width=32) (actual time=1.028..1.031 rows=21 loops=1)

2. 0.014 1.029 ↑ 1.1 21 1

Sort (cost=622.24..622.30 rows=23 width=1,237) (actual time=1.027..1.029 rows=21 loops=1)

  • Sort Key: m.created
  • Sort Method: quicksort Memory: 26kB
3. 0.037 1.015 ↑ 1.1 21 1

Nested Loop (cost=3.99..621.72 rows=23 width=1,237) (actual time=0.146..1.015 rows=21 loops=1)

  • Join Filter: (a.unidad_id = inv_unidades.id)
  • Rows Removed by Join Filter: 168
4. 0.018 0.957 ↑ 1.1 21 1

Nested Loop (cost=3.99..617.27 rows=23 width=29) (actual time=0.138..0.957 rows=21 loops=1)

  • Join Filter: (inv_almacenes.empresa_id = erp_empresas.id)
  • Rows Removed by Join Filter: 63
5. 0.000 0.939 ↑ 1.1 21 1

Nested Loop (cost=3.99..614.84 rows=23 width=37) (actual time=0.132..0.939 rows=21 loops=1)

6. 0.012 0.877 ↑ 1.1 21 1

Hash Join (cost=3.85..610.88 rows=23 width=37) (actual time=0.130..0.877 rows=21 loops=1)

  • Hash Cond: (p.tipo_presentacion_id = tp.id)
7. 0.012 0.846 ↑ 1.1 21 1

Nested Loop (cost=1.41..608.12 rows=23 width=45) (actual time=0.106..0.846 rows=21 loops=1)

8. 0.045 0.792 ↑ 1.1 21 1

Nested Loop (cost=1.12..599.48 rows=23 width=53) (actual time=0.101..0.792 rows=21 loops=1)

  • Join Filter: (m.tipo_id = tm.id)
  • Rows Removed by Join Filter: 126
9. 0.007 0.705 ↑ 1.1 21 1

Nested Loop (cost=1.12..595.98 rows=23 width=53) (actual time=0.067..0.705 rows=21 loops=1)

10. 0.008 0.635 ↑ 1.1 21 1

Nested Loop (cost=0.84..587.74 rows=24 width=37) (actual time=0.064..0.635 rows=21 loops=1)

11. 0.023 0.035 ↑ 1.0 1 1

Nested Loop (cost=0.55..16.60 rows=1 width=24) (actual time=0.032..0.035 rows=1 loops=1)

12. 0.007 0.007 ↑ 1.0 1 1

Index Scan using inv_presentaciones_uk on inv_presentaciones p (cost=0.28..8.29 rows=1 width=24) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (articulo_id = 587)
13. 0.005 0.005 ↑ 1.0 1 1

Index Scan using inv_articulos_pkey on inv_articulos a (cost=0.28..8.29 rows=1 width=16) (actual time=0.003..0.005 rows=1 loops=1)

  • Index Cond: (id = 587)
14. 0.592 0.592 ↑ 1.1 21 1

Index Scan using inv_movimientos_detalles_uk1 on inv_movimientos_detalles d (cost=0.29..570.90 rows=24 width=29) (actual time=0.030..0.592 rows=21 loops=1)

  • Index Cond: (presentacion_id = p.id)
  • Filter: (id < 20556)
  • Rows Removed by Filter: 1
15. 0.063 0.063 ↑ 1.0 1 21

Index Scan using inv_movimientos_id_idx on inv_movimientos m (cost=0.28..0.33 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=21)

  • Index Cond: (id = d.movimiento_id)
  • Filter: (status = 1)
16. 0.011 0.042 ↑ 1.0 7 21

Materialize (cost=0.00..1.11 rows=7 width=8) (actual time=0.002..0.002 rows=7 loops=21)

17. 0.031 0.031 ↑ 1.0 7 1

Seq Scan on inv_tipos_movimientos tm (cost=0.00..1.07 rows=7 width=8) (actual time=0.030..0.031 rows=7 loops=1)

18. 0.042 0.042 ↑ 1.0 1 21

Index Only Scan using inv_lotes_pkey on inv_lotes (cost=0.29..0.37 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=21)

  • Index Cond: (id = d.lote_id)
  • Heap Fetches: 21
19. 0.009 0.019 ↑ 1.0 64 1

Hash (cost=1.64..1.64 rows=64 width=8) (actual time=0.019..0.019 rows=64 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
20. 0.010 0.010 ↑ 1.0 64 1

Seq Scan on inv_tipos_presentaciones tp (cost=0.00..1.64 rows=64 width=8) (actual time=0.005..0.010 rows=64 loops=1)

21. 0.063 0.063 ↑ 1.0 1 21

Index Scan using inv_almacenes_pkey on inv_almacenes (cost=0.14..0.16 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=21)

  • Index Cond: (id = m.almacen_id)
22. 0.000 0.000 ↑ 1.0 4 21

Materialize (cost=0.00..1.06 rows=4 width=8) (actual time=0.000..0.000 rows=4 loops=21)

23. 0.005 0.005 ↑ 1.0 4 1

Seq Scan on erp_empresas (cost=0.00..1.04 rows=4 width=8) (actual time=0.005..0.005 rows=4 loops=1)

24. 0.017 0.021 ↑ 1.0 9 21

Materialize (cost=0.00..1.14 rows=9 width=8) (actual time=0.000..0.001 rows=9 loops=21)

25. 0.004 0.004 ↑ 1.0 9 1

Seq Scan on inv_unidades (cost=0.00..1.09 rows=9 width=8) (actual time=0.004..0.004 rows=9 loops=1)

Planning time : 2.231 ms
Execution time : 1.157 ms