explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qoT6 : 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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 82.528 11,185.250 ↑ 1.0 2,515 1

Hash Left Join (cost=844.46..3,523,798.07 rows=2,524 width=377) (actual time=110.966..11,185.250 rows=2,515 loops=1)

  • Hash Cond: (barrio.cod_city = city.id)
2. 14.354 184.113 ↑ 1.0 2,515 1

Hash Left Join (cost=828.85..1,160.83 rows=2,524 width=334) (actual time=106.765..184.113 rows=2,515 loops=1)

  • Hash Cond: (ubicacion.id_barrio = barrio.id_barrio)
3. 15.262 165.214 ↑ 1.0 2,515 1

Hash Left Join (cost=769.70..1,063.83 rows=2,524 width=320) (actual time=102.179..165.214 rows=2,515 loops=1)

  • Hash Cond: (planificacion.id_ubicacion = ubicacion.id_ubicacion)
4. 35.092 142.243 ↑ 1.0 2,515 1

Hash Join (cost=643.34..913.26 rows=2,524 width=233) (actual time=94.418..142.243 rows=2,515 loops=1)

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

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

6. 9.559 94.326 ↑ 1.0 2,515 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 439kB
7. 6.769 84.767 ↑ 1.0 2,515 1

Hash Join (cost=108.75..611.79 rows=2,524 width=201) (actual time=7.868..84.767 rows=2,515 loops=1)

  • Hash Cond: (planificacion.id_unidad_operativa = unidad_operativa.id_unidad_operativa)
8. 22.358 77.777 ↑ 1.0 2,515 1

Nested Loop (cost=104.61..572.94 rows=2,524 width=185) (actual time=7.624..77.777 rows=2,515 loops=1)

9. 0.011 0.011 ↑ 1.0 1 1

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

  • Filter: (id_subestado = 2)
  • Rows Removed by Filter: 2
10. 7.682 55.408 ↑ 1.0 2,515 1

Hash Join (cost=104.61..546.67 rows=2,524 width=189) (actual time=7.610..55.408 rows=2,515 loops=1)

  • Hash Cond: (planificacion.id_estado = estado_planificacion.id_estado)
11. 10.152 47.713 ↑ 1.0 2,515 1

Hash Join (cost=103.52..510.87 rows=2,524 width=193) (actual time=7.576..47.713 rows=2,515 loops=1)

  • Hash Cond: (planificacion.id_especialiadad = especialidades.id_especialidades)
12. 12.192 30.487 ↑ 1.0 2,518 1

Hash Join (cost=40.90..413.54 rows=2,527 width=51) (actual time=0.477..30.487 rows=2,518 loops=1)

  • Hash Cond: (planificacion.id_modalidad = modalidad.id_modalidad)
13. 17.890 18.286 ↑ 1.0 2,528 1

Bitmap Heap Scan on planificacion (cost=39.86..377.70 rows=2,540 width=44) (actual time=0.446..18.286 rows=2,528 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.396 0.396 ↑ 1.0 2,792 1

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

  • Index Cond: (id_subestado = 2)
15. 0.005 0.009 ↑ 1.0 2 1

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

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

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

17. 1.122 7.074 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
18. 3.607 5.952 ↓ 1.0 885 1

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

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

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

20. 0.059 0.281 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
21. 0.120 0.222 ↑ 1.0 57 1

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

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

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

23. 0.025 0.048 ↑ 1.0 24 1

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

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

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

25. 0.006 0.013 ↑ 1.0 4 1

Hash (cost=1.04..1.04 rows=4 width=4) (actual time=0.013..0.013 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.119 0.221 ↑ 1.0 95 1

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

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

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

29. 3.758 7.709 ↓ 1.0 2,998 1

Hash (cost=88.94..88.94 rows=2,994 width=95) (actual time=7.709..7.709 rows=2,998 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 380kB
30. 3.951 3.951 ↓ 1.0 2,998 1

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

31. 2.347 4.545 ↓ 1.0 2,053 1

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

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

Seq Scan on barrio (cost=0.00..33.51 rows=2,051 width=20) (actual time=0.007..2.198 rows=2,053 loops=1)

33. 0.279 0.994 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
34. 0.471 0.715 ↑ 1.0 254 1

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

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

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

36. 0.020 0.041 ↑ 1.0 18 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
37. 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)

38.          

SubPlan (forHash Left Join)

39. 70.420 10,917.615 ↑ 1.0 1 2,515

Aggregate (cost=1,395.61..1,395.62 rows=1 width=8) (actual time=4.340..4.341 rows=1 loops=2,515)

40. 10,847.195 10,847.195 ↑ 1.6 16 2,515

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.794..4.313 rows=16 loops=2,515)

  • Index Cond: (id_planificacion = planificacion.id_planificacion)
  • Filter: (estado_inscripcion = 1)
  • Rows Removed by Filter: 8