explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0lwx

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 3,822.811 17,003.120 ↑ 1.0 2,660,319 1

Hash Left Join (cost=13,651.18..195,353.39 rows=2,660,319 width=391) (actual time=1,053.419..17,003.120 rows=2,660,319 loops=1)

  • Hash Cond: (empresas.id_categoria_empresa = empresas_categorias.id_categoria_empresa)
2. 4,061.405 13,180.298 ↑ 1.0 2,660,319 1

Hash Left Join (cost=13,650.09..184,688.85 rows=2,660,319 width=381) (actual time=1,053.388..13,180.298 rows=2,660,319 loops=1)

  • Hash Cond: (empresas.type = empresas_types.id)
3. 5,658.603 9,118.839 ↑ 1.0 2,660,319 1

Hash Left Join (cost=13,648.41..148,107.79 rows=2,660,319 width=374) (actual time=1,053.310..9,118.839 rows=2,660,319 loops=1)

  • Hash Cond: (empleado.nropatronal = empresas_sucursales.nro_patronal)
4. 2,407.061 2,407.061 ↑ 1.0 2,660,319 1

Seq Scan on empleado (cost=0.00..52,247.19 rows=2,660,319 width=30) (actual time=0.038..2,407.061 rows=2,660,319 loops=1)

5. 153.980 1,053.175 ↓ 1.0 56,881 1

Hash (cost=10,327.61..10,327.61 rows=56,864 width=348) (actual time=1,053.175..1,053.175 rows=56,881 loops=1)

  • Buckets: 4096 Batches: 2 Memory Usage: 9971kB
6. 149.554 899.195 ↓ 1.0 56,881 1

Hash Left Join (cost=2,720.94..10,327.61 rows=56,864 width=348) (actual time=127.448..899.195 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.empresa_id = empresas.id)
7. 101.463 624.851 ↓ 1.0 56,881 1

Hash Left Join (cost=41.27..6,510.67 rows=56,864 width=344) (actual time=2.554..624.851 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.id_tipo_inscripcion = empresas_tipo_inscripcion.id_tipo_inscripcion)
8. 106.402 523.376 ↓ 1.0 56,881 1

Hash Left Join (cost=40.21..5,727.73 rows=56,864 width=328) (actual time=2.514..523.376 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.id_activ_econ = actividad_econ.id_activ_econ)
9. 103.635 415.293 ↓ 1.0 56,881 1

Hash Left Join (cost=15.14..4,920.80 rows=56,864 width=278) (actual time=0.797..415.293 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.distrito_id = distritos.id)
10. 105.868 311.618 ↓ 1.0 56,881 1

Hash Left Join (cost=13.74..4,137.99 rows=56,864 width=275) (actual time=0.720..311.618 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.city_id = city.id)
11. 102.143 205.144 ↓ 1.0 56,881 1

Hash Left Join (cost=1.07..3,346.59 rows=56,864 width=247) (actual time=0.069..205.144 rows=56,881 loops=1)

  • Hash Cond: (empresas_sucursales.type = empresas_sucursales_types.id)
12. 102.981 102.981 ↓ 1.0 56,881 1

Seq Scan on empresas_sucursales (cost=0.00..2,563.64 rows=56,864 width=240) (actual time=0.013..102.981 rows=56,881 loops=1)

13. 0.013 0.020 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=23) (actual time=0.020..0.020 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
14. 0.007 0.007 ↑ 1.0 3 1

Seq Scan on empresas_sucursales_types (cost=0.00..1.03 rows=3 width=23) (actual time=0.003..0.007 rows=3 loops=1)

15. 0.298 0.606 ↑ 1.0 252 1

Hash (cost=9.52..9.52 rows=252 width=40) (actual time=0.606..0.606 rows=252 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
16. 0.308 0.308 ↑ 1.0 252 1

Seq Scan on city (cost=0.00..9.52 rows=252 width=40) (actual time=0.009..0.308 rows=252 loops=1)

17. 0.019 0.040 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=19) (actual time=0.040..0.040 rows=18 loops=1)

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

Seq Scan on distritos (cost=0.00..1.18 rows=18 width=19) (actual time=0.004..0.021 rows=18 loops=1)

19. 0.890 1.681 ↑ 1.0 714 1

Hash (cost=16.14..16.14 rows=714 width=58) (actual time=1.681..1.681 rows=714 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 65kB
20. 0.791 0.791 ↑ 1.0 714 1

Seq Scan on actividad_econ (cost=0.00..16.14 rows=714 width=58) (actual time=0.005..0.791 rows=714 loops=1)

21. 0.005 0.012 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=24) (actual time=0.012..0.012 rows=3 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
22. 0.007 0.007 ↑ 1.0 3 1

Seq Scan on empresas_tipo_inscripcion (cost=0.00..1.03 rows=3 width=24) (actual time=0.003..0.007 rows=3 loops=1)

23. 51.746 124.790 ↓ 1.0 50,710 1

Hash (cost=2,045.96..2,045.96 rows=50,696 width=20) (actual time=124.790..124.790 rows=50,710 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2383kB
24. 73.044 73.044 ↓ 1.0 50,710 1

Seq Scan on empresas (cost=0.00..2,045.96 rows=50,696 width=20) (actual time=0.012..73.044 rows=50,710 loops=1)

25. 0.029 0.054 ↑ 1.0 30 1

Hash (cost=1.30..1.30 rows=30 width=23) (actual time=0.054..0.054 rows=30 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
26. 0.025 0.025 ↑ 1.0 30 1

Seq Scan on empresas_types (cost=0.00..1.30 rows=30 width=23) (actual time=0.003..0.025 rows=30 loops=1)

27. 0.006 0.011 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=18) (actual time=0.011..0.011 rows=4 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
28. 0.005 0.005 ↑ 1.0 4 1

Seq Scan on empresas_categorias (cost=0.00..1.04 rows=4 width=18) (actual time=0.003..0.005 rows=4 loops=1)