explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ePdt : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #n2L3; plan #GZUh; plan #4Qpx; plan #MmqD; plan #npE5; plan #CDiH; plan #F10U; plan #qoT6

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 79.306 10,486.057 ↑ 1.0 2,517 1

Hash Left Join (cost=844.46..3,523,798.07 rows=2,524 width=377) (actual time=89.178..10,486.057 rows=2,517 loops=1)

  • Hash Cond: (barrio.cod_city = city.id)
2. 13.837 161.282 ↑ 1.0 2,517 1

Hash Left Join (cost=828.85..1,160.83 rows=2,524 width=334) (actual time=82.111..161.282 rows=2,517 loops=1)

  • Hash Cond: (ubicacion.id_barrio = barrio.id_barrio)
3. 20.100 127.762 ↑ 1.0 2,517 1

Hash Left Join (cost=769.70..1,063.83 rows=2,524 width=320) (actual time=62.388..127.762 rows=2,517 loops=1)

  • Hash Cond: (planificacion.id_ubicacion = ubicacion.id_ubicacion)
4. 31.755 94.305 ↑ 1.0 2,517 1

Hash Join (cost=643.34..913.26 rows=2,524 width=233) (actual time=48.993..94.305 rows=2,517 loops=1)

  • Hash Cond: (periodo.id_planificacion = planificacion.id_planificacion)
5. 13.634 13.634 ↑ 1.0 9,912 1

Seq Scan on periodo (cost=0.00..195.12 rows=9,912 width=36) (actual time=0.006..13.634 rows=9,912 loops=1)

6. 4.713 48.916 ↑ 1.0 2,517 1

Hash (cost=611.79..611.79 rows=2,524 width=201) (actual time=48.916..48.916 rows=2,517 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 439kB
7. 5.078 44.203 ↑ 1.0 2,517 1

Hash Join (cost=108.75..611.79 rows=2,524 width=201) (actual time=13.383..44.203 rows=2,517 loops=1)

  • Hash Cond: (planificacion.id_unidad_operativa = unidad_operativa.id_unidad_operativa)
8. 4.154 38.937 ↑ 1.0 2,517 1

Nested Loop (cost=104.61..572.94 rows=2,524 width=185) (actual time=13.183..38.937 rows=2,517 loops=1)

9. 0.010 0.010 ↑ 1.0 1 1

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

  • Filter: (id_subestado = 2)
  • Rows Removed by Filter: 2
10. 4.828 34.773 ↑ 1.0 2,517 1

Hash Join (cost=104.61..546.67 rows=2,524 width=189) (actual time=13.170..34.773 rows=2,517 loops=1)

  • Hash Cond: (planificacion.id_estado = estado_planificacion.id_estado)
11. 5.523 29.933 ↑ 1.0 2,517 1

Hash Join (cost=103.52..510.87 rows=2,524 width=193) (actual time=13.146..29.933 rows=2,517 loops=1)

  • Hash Cond: (planificacion.id_especialiadad = especialidades.id_especialidades)
12. 4.996 12.200 ↑ 1.0 2,520 1

Hash Join (cost=40.90..413.54 rows=2,527 width=51) (actual time=0.908..12.200 rows=2,520 loops=1)

  • Hash Cond: (planificacion.id_modalidad = modalidad.id_modalidad)
13. 6.402 7.196 ↑ 1.0 2,530 1

Bitmap Heap Scan on planificacion (cost=39.86..377.70 rows=2,540 width=44) (actual time=0.891..7.196 rows=2,530 loops=1)

  • Recheck Cond: (id_subestado = 2)
  • Filter: ((id_tipo_insc = 1) AND ((id_estado = 2) OR (id_estado = 3)))
  • Rows Removed by Filter: 264
14. 0.794 0.794 ↓ 1.0 2,795 1

Bitmap Index Scan on planificacion_id_subestado_idx (cost=0.00..39.22 rows=2,792 width=0) (actual time=0.794..0.794 rows=2,795 loops=1)

  • Index Cond: (id_subestado = 2)
15. 0.003 0.008 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=15) (actual time=0.008..0.008 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
16. 0.005 0.005 ↑ 1.0 2 1

Seq Scan on modalidad (cost=0.00..1.02 rows=2 width=15) (actual time=0.003..0.005 rows=2 loops=1)

17. 4.837 12.210 ↓ 1.0 885 1

Hash (cost=51.58..51.58 rows=883 width=150) (actual time=12.210..12.210 rows=885 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
18. 3.454 7.373 ↓ 1.0 885 1

Hash Join (cost=4.61..51.58 rows=883 width=150) (actual time=0.407..7.373 rows=885 loops=1)

  • Hash Cond: (especialidades.id_area = areas.id_areas)
19. 3.570 3.570 ↓ 1.0 885 1

Seq Scan on especialidades (cost=0.00..34.83 rows=883 width=116) (actual time=0.009..3.570 rows=885 loops=1)

20. 0.067 0.349 ↑ 1.0 57 1

Hash (cost=3.89..3.89 rows=57 width=42) (actual time=0.349..0.349 rows=57 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
21. 0.182 0.282 ↑ 1.0 57 1

Hash Join (cost=1.54..3.89 rows=57 width=42) (actual time=0.078..0.282 rows=57 loops=1)

  • Hash Cond: (areas.id_familia_profesional = programas_formacion_familias.id_prog_formacion)
22. 0.051 0.051 ↑ 1.0 57 1

Seq Scan on areas (cost=0.00..1.57 rows=57 width=25) (actual time=0.005..0.051 rows=57 loops=1)

23. 0.025 0.049 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=29) (actual time=0.049..0.049 rows=24 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
24. 0.024 0.024 ↑ 1.0 24 1

Seq Scan on programas_formacion_familias (cost=0.00..1.24 rows=24 width=29) (actual time=0.004..0.024 rows=24 loops=1)

25. 0.005 0.012 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
26. 0.007 0.007 ↑ 1.0 4 1

Seq Scan on estado_planificacion (cost=0.00..1.04 rows=4 width=4) (actual time=0.004..0.007 rows=4 loops=1)

27. 0.096 0.188 ↑ 1.0 95 1

Hash (cost=2.95..2.95 rows=95 width=22) (actual time=0.188..0.188 rows=95 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
28. 0.092 0.092 ↑ 1.0 95 1

Seq Scan on unidad_operativa (cost=0.00..2.95 rows=95 width=22) (actual time=0.004..0.092 rows=95 loops=1)

29. 4.173 13.357 ↓ 1.0 3,000 1

Hash (cost=88.94..88.94 rows=2,994 width=95) (actual time=13.357..13.357 rows=3,000 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 380kB
30. 9.184 9.184 ↓ 1.0 3,000 1

Seq Scan on ubicacion (cost=0.00..88.94 rows=2,994 width=95) (actual time=0.007..9.184 rows=3,000 loops=1)

31. 11.756 19.683 ↓ 1.0 2,055 1

Hash (cost=33.51..33.51 rows=2,051 width=20) (actual time=19.683..19.683 rows=2,055 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 107kB
32. 7.927 7.927 ↓ 1.0 2,055 1

Seq Scan on barrio (cost=0.00..33.51 rows=2,051 width=20) (actual time=0.008..7.927 rows=2,055 loops=1)

33. 1.974 3.796 ↑ 1.0 254 1

Hash (cost=12.44..12.44 rows=254 width=51) (actual time=3.796..3.796 rows=254 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
34. 0.504 1.822 ↑ 1.0 254 1

Hash Left Join (cost=1.41..12.44 rows=254 width=51) (actual time=0.076..1.822 rows=254 loops=1)

  • Hash Cond: (city.distrito_id = distritos.id)
35. 1.275 1.275 ↑ 1.0 254 1

Seq Scan on city (cost=0.00..7.54 rows=254 width=48) (actual time=0.007..1.275 rows=254 loops=1)

36. 0.021 0.043 ↑ 1.0 18 1

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

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

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

38.          

SubPlan (for Hash Left Join)

39. 60.408 10,241.673 ↑ 1.0 1 2,517

Aggregate (cost=1,395.61..1,395.62 rows=1 width=8) (actual time=4.068..4.069 rows=1 loops=2,517)

40. 10,181.265 10,181.265 ↑ 1.6 16 2,517

Index Scan using inscripcion_alumno_id_alumno_id_planificacion_idx on inscripcion_alumno insxx (cost=0.42..1,395.55 rows=25 width=8) (actual time=1.657..4.045 rows=16 loops=2,517)

  • Index Cond: (id_planificacion = planificacion.id_planificacion)
  • Filter: (estado_inscripcion = 1)
  • Rows Removed by Filter: 8
Total runtime : 10,489.503 ms