explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XOLu

Settings
# exclusive inclusive rows x rows loops node
1. 0.030 67.565 ↑ 1.0 1 1

Nested Loop Left Join (cost=13,307.22..13,361.95 rows=1 width=847) (actual time=67.546..67.565 rows=1 loops=1)

2.          

Initplan (forNested Loop Left Join)

3. 0.013 0.013 ↑ 1.0 1 1

Seq Scan on cajas cj (cost=0.00..1.03 rows=1 width=32) (actual time=0.013..0.013 rows=1 loops=1)

  • Filter: (id = 1)
  • Rows Removed by Filter: 1
4. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuracion_local (cost=0.00..27.13 rows=2 width=32) (never executed)

  • Filter: ((equipo)::text ~~* 'E0-D5-5E-19-A7-DF'::text)
5. 0.004 36.557 ↑ 1.0 1 1

Aggregate (cost=6,221.78..6,221.79 rows=1 width=3) (actual time=36.557..36.557 rows=1 loops=1)

6. 36.553 36.553 ↓ 0.0 0 1

Seq Scan on detalle_ventas (cost=0.00..6,221.77 rows=1 width=3) (actual time=36.553..36.553 rows=0 loops=1)

  • Filter: (((cortesia)::text ~~* 'CONVENIO'::text) AND (venta = 1852))
  • Rows Removed by Filter: 152355
7. 0.003 29.925 ↑ 1.0 1 1

Aggregate (cost=6,221.78..6,221.79 rows=1 width=3) (actual time=29.925..29.925 rows=1 loops=1)

8. 29.922 29.922 ↓ 0.0 0 1

Seq Scan on detalle_ventas detalle_ventas_1 (cost=0.00..6,221.77 rows=1 width=3) (actual time=29.922..29.922 rows=0 loops=1)

  • Filter: (((cortesia)::text ~~* 'PROMOCIÓN'::text) AND (venta = 1852))
  • Rows Removed by Filter: 152355
9. 0.001 0.954 ↑ 1.0 1 1

Limit (cost=0.00..833.40 rows=1 width=6) (actual time=0.953..0.954 rows=1 loops=1)

10. 0.953 0.953 ↑ 7.0 1 1

Seq Scan on detalle_ventas detalle_ventas_2 (cost=0.00..5,833.81 rows=7 width=6) (actual time=0.953..0.953 rows=1 loops=1)

  • Filter: (venta = 1852)
  • Rows Removed by Filter: 10303
11. 0.002 0.076 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.81..48.27 rows=1 width=841) (actual time=0.060..0.076 rows=1 loops=1)

12. 0.008 0.069 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.53..47.92 rows=1 width=841) (actual time=0.055..0.069 rows=1 loops=1)

  • Join Filter: (ee.id = v.vendedor)
  • Rows Removed by Join Filter: 45
13. 0.001 0.052 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.53..42.78 rows=1 width=826) (actual time=0.044..0.052 rows=1 loops=1)

14. 0.000 0.046 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.27..34.48 rows=1 width=825) (actual time=0.040..0.046 rows=1 loops=1)

15. 0.002 0.041 ↑ 1.0 1 1

Nested Loop Left Join (cost=1.13..34.27 rows=1 width=817) (actual time=0.036..0.041 rows=1 loops=1)

16. 0.005 0.035 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.85..25.97 rows=1 width=817) (actual time=0.031..0.035 rows=1 loops=1)

  • Join Filter: (v.caja = c.id)
  • Rows Removed by Join Filter: 1
17. 0.002 0.027 ↑ 1.0 1 1

Nested Loop (cost=0.85..24.93 rows=1 width=808) (actual time=0.024..0.027 rows=1 loops=1)

18. 0.004 0.021 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.57..16.62 rows=1 width=750) (actual time=0.019..0.021 rows=1 loops=1)

19. 0.011 0.011 ↑ 1.0 1 1

Index Scan using ventas_pkey on ventas v (cost=0.29..8.30 rows=1 width=726) (actual time=0.010..0.011 rows=1 loops=1)

  • Index Cond: (id = 1852)
20. 0.006 0.006 ↑ 1.0 1 1

Index Scan using cajas_movimientos_pkey on cajas_movimientos cm (cost=0.29..8.30 rows=1 width=32) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = v.movimientoscaja)
21. 0.004 0.004 ↑ 1.0 1 1

Index Scan using clientes_pkey on clientes cl (cost=0.28..8.29 rows=1 width=62) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = v.cliente)
22. 0.003 0.003 ↑ 1.0 2 1

Seq Scan on cajas c (cost=0.00..1.02 rows=2 width=17) (actual time=0.002..0.003 rows=2 loops=1)

23. 0.004 0.004 ↑ 1.0 1 1

Index Scan using sesiones_caja_pkey on sesiones_caja sc (cost=0.28..8.29 rows=1 width=8) (actual time=0.003..0.004 rows=1 loops=1)

  • Index Cond: (id = v.sesioncaja)
24. 0.005 0.005 ↑ 1.0 1 1

Index Scan using usuarios_pkey on empleados e (cost=0.14..0.20 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (id = sc.cajero)
25. 0.005 0.005 ↑ 1.0 1 1

Index Scan using mesas_pkey on mesas m (cost=0.27..8.28 rows=1 width=9) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (v.mesa = id)
26. 0.009 0.009 ↑ 1.1 46 1

Seq Scan on empleados ee (cost=0.00..4.51 rows=51 width=23) (actual time=0.002..0.009 rows=46 loops=1)

27. 0.005 0.005 ↑ 1.0 1 1

Index Only Scan using telefonosclientes_pkey on telefonosclientes tc (cost=0.28..0.34 rows=1 width=8) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (cliente = cl.id)
  • Heap Fetches: 1
28. 0.006 0.006 ↑ 1.0 1 1

Index Scan using telefonos_pkey on telefonos t (cost=0.28..0.34 rows=1 width=14) (actual time=0.003..0.006 rows=1 loops=1)

  • Index Cond: (tc.telefono = id)
29.          

SubPlan (forNested Loop Left Join)

30. 0.004 0.004 ↑ 1.0 1 1

Index Scan using divisas_pkey on divisas (cost=0.15..8.17 rows=1 width=118) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: (id = COALESCE(cm.divisa, v.divisa))
Planning time : 3.240 ms
Execution time : 68.033 ms