explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lJvx : Optimization for: Optimization for: Optimization for: Optimization for: plan #loWb; plan #MAEG; plan #ZY8K; plan #MZ8N

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,425.475 5,169.261 ↓ 1.8 165,586 1

Sort (cost=23,254.68..23,484.71 rows=92,012 width=152) (actual time=4,854.593..5,169.261 rows=165,586 loops=1)

  • Sort Key: cobro.fecha
  • Sort Method: external merge Disk: 28576kB
2. 540.832 3,743.786 ↓ 1.8 165,586 1

Hash Join (cost=4,645.03..10,726.01 rows=92,012 width=152) (actual time=2,413.285..3,743.786 rows=165,586 loops=1)

  • Hash Cond: (venta_caja.id_producto = producto.idproducto)
3. 533.639 3,202.852 ↓ 1.8 165,656 1

Hash Join (cost=4,642.88..9,458.59 rows=92,040 width=119) (actual time=2,413.157..3,202.852 rows=165,656 loops=1)

  • Hash Cond: (venta_caja.id_cobro = cobro.id_cobro)
4. 256.132 256.132 ↑ 1.0 48,602 1

Seq Scan on venta_caja (cost=0.00..977.33 rows=48,633 width=20) (actual time=0.016..256.132 rows=48,602 loops=1)

5. 204.198 2,413.081 ↓ 1.2 54,636 1

Hash (cost=4,064.67..4,064.67 rows=46,257 width=111) (actual time=2,413.081..2,413.081 rows=54,636 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 8018kB
6. 256.666 2,208.883 ↓ 1.2 54,636 1

Hash Join (cost=56.13..4,064.67 rows=46,257 width=111) (actual time=4.668..2,208.883 rows=54,636 loops=1)

  • Hash Cond: (cobro_detalle.id_forma_cobro = forma_de_cobro.idforma_de_cobro)
7. 504.793 1,952.210 ↓ 1.2 54,636 1

Nested Loop (cost=55.08..3,427.59 rows=46,257 width=107) (actual time=4.642..1,952.210 rows=54,636 loops=1)

8. 180.810 333.007 ↓ 1.0 33,770 1

Hash Join (cost=55.08..1,362.10 rows=33,769 width=83) (actual time=4.575..333.007 rows=33,770 loops=1)

  • Hash Cond: (cobro.idapertura_cierre = apertura_cierre.idapertura_cierre)
9. 147.657 147.657 ↓ 1.0 33,770 1

Seq Scan on cobro (cost=0.00..842.69 rows=33,769 width=56) (actual time=0.013..147.657 rows=33,770 loops=1)

10. 0.845 4.540 ↑ 1.0 892 1

Hash (cost=43.93..43.93 rows=892 width=35) (actual time=4.540..4.540 rows=892 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 58kB
11. 1.426 3.695 ↑ 1.0 892 1

Hash Join (cost=3.48..43.93 rows=892 width=35) (actual time=0.099..3.695 rows=892 loops=1)

  • Hash Cond: (apertura_cierre.idcaja = caja.idcaja)
12. 1.474 2.255 ↑ 1.0 892 1

Hash Join (cost=2.35..30.53 rows=892 width=26) (actual time=0.071..2.255 rows=892 loops=1)

  • Hash Cond: (apertura_cierre.idcajero = cajero.idcajero)
13. 0.730 0.730 ↑ 1.0 892 1

Seq Scan on apertura_cierre (cost=0.00..15.92 rows=892 width=12) (actual time=0.003..0.730 rows=892 loops=1)

14. 0.003 0.051 ↑ 1.0 5 1

Hash (cost=2.29..2.29 rows=5 width=18) (actual time=0.051..0.051 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
15. 0.028 0.048 ↑ 1.0 5 1

Hash Join (cost=1.11..2.29 rows=5 width=18) (actual time=0.030..0.048 rows=5 loops=1)

  • Hash Cond: (usuario_caja.idusuario = cajero.idusuario)
16. 0.009 0.009 ↑ 1.0 9 1

Seq Scan on usuario_caja (cost=0.00..1.09 rows=9 width=18) (actual time=0.002..0.009 rows=9 loops=1)

17. 0.005 0.011 ↑ 1.0 5 1

Hash (cost=1.05..1.05 rows=5 width=8) (actual time=0.011..0.011 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
18. 0.006 0.006 ↑ 1.0 5 1

Seq Scan on cajero (cost=0.00..1.05 rows=5 width=8) (actual time=0.003..0.006 rows=5 loops=1)

19. 0.006 0.014 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=17) (actual time=0.014..0.014 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
20. 0.008 0.008 ↑ 1.0 6 1

Seq Scan on caja (cost=0.00..1.06 rows=6 width=17) (actual time=0.003..0.008 rows=6 loops=1)

21. 1,114.410 1,114.410 ↓ 2.0 2 33,770

Index Scan using cobro_detalle_id_cobro_idx on cobro_detalle (cost=0.00..0.05 rows=1 width=32) (actual time=0.025..0.033 rows=2 loops=33,770)

  • Index Cond: (id_cobro = cobro.id_cobro)
  • Filter: (cobro.idtipo_documento = idtipo_documento)
  • Rows Removed by Filter: 0
22. 0.003 0.007 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=12) (actual time=0.007..0.007 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
23. 0.004 0.004 ↑ 1.0 2 1

Seq Scan on forma_de_cobro (cost=0.00..1.02 rows=2 width=12) (actual time=0.003..0.004 rows=2 loops=1)

24. 0.057 0.102 ↑ 1.0 51 1

Hash (cost=1.51..1.51 rows=51 width=41) (actual time=0.102..0.102 rows=51 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
25. 0.045 0.045 ↑ 1.0 51 1

Seq Scan on producto (cost=0.00..1.51 rows=51 width=41) (actual time=0.004..0.045 rows=51 loops=1)