explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 87.788 10,006.251 ↑ 1.0 2,514 1

Hash Left Join (cost=974.42..3,520,398.12 rows=2,523 width=377) (actual time=61.620..10,006.251 rows=2,514 loops=1)

  • Hash Cond: (ubicacion.id_barrio = barrio.id_barrio)
2. 17.930 118.134 ↑ 1.0 2,514 1

Hash Left Join (cost=872.16..1,166.26 rows=2,523 width=320) (actual time=50.819..118.134 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_ubicacion = ubicacion.id_ubicacion)
3. 35.796 93.029 ↑ 1.0 2,514 1

Hash Join (cost=745.80..1,015.71 rows=2,523 width=233) (actual time=43.607..93.029 rows=2,514 loops=1)

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

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

5. 5.563 43.503 ↑ 1.0 2,514 1

Hash (cost=714.26..714.26 rows=2,523 width=201) (actual time=43.503..43.503 rows=2,514 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 438kB
6. 4.885 37.940 ↑ 1.0 2,514 1

Hash Join (cost=68.89..714.26 rows=2,523 width=201) (actual time=4.683..37.940 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_unidad_operativa = unidad_operativa.id_unidad_operativa)
7. 4.484 32.870 ↑ 1.0 2,514 1

Nested Loop (cost=64.75..675.43 rows=2,523 width=185) (actual time=4.477..32.870 rows=2,514 loops=1)

8. 0.009 0.009 ↑ 1.0 1 1

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

  • Filter: (id_subestado = 2)
  • Rows Removed by Filter: 2
9. 4.578 28.377 ↑ 1.0 2,514 1

Hash Join (cost=64.75..649.17 rows=2,523 width=189) (actual time=4.465..28.377 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_estado = estado_planificacion.id_estado)
10. 5.811 23.787 ↑ 1.0 2,514 1

Hash Join (cost=63.66..613.38 rows=2,523 width=193) (actual time=4.430..23.787 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_especialiadad = especialidades.id_especialidades)
11. 5.181 13.769 ↑ 1.0 2,517 1

Hash Join (cost=1.04..516.07 rows=2,526 width=51) (actual time=0.054..13.769 rows=2,517 loops=1)

  • Hash Cond: (planificacion.id_modalidad = modalidad.id_modalidad)
12. 8.579 8.579 ↑ 1.0 2,527 1

Seq Scan on planificacion (cost=0.00..480.24 rows=2,539 width=44) (actual time=0.007..8.579 rows=2,527 loops=1)

  • Filter: ((id_subestado = 2) AND (id_tipo_insc = 1) AND ((id_estado = 2) OR (id_estado = 3)))
  • Rows Removed by Filter: 7385
13. 0.004 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
14. 0.005 0.005 ↑ 1.0 2 1

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

15. 1.145 4.207 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
16. 1.774 3.062 ↓ 1.0 885 1

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

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

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

18. 0.067 0.291 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
19. 0.121 0.224 ↑ 1.0 57 1

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

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

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

21. 0.035 0.058 ↑ 1.0 24 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 2kB
22. 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.003..0.023 rows=24 loops=1)

23. 0.006 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
24. 0.006 0.006 ↑ 1.0 4 1

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

25. 0.099 0.185 ↑ 1.0 95 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
26. 0.086 0.086 ↑ 1.0 95 1

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

27. 3.788 7.175 ↓ 1.0 2,997 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 379kB
28. 3.387 3.387 ↓ 1.0 2,997 1

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

29. 2.192 8.299 ↑ 1.0 2,051 1

Hash (cost=76.61..76.61 rows=2,051 width=63) (actual time=8.299..8.299 rows=2,051 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 189kB
30. 3.550 6.107 ↑ 1.0 2,051 1

Hash Left Join (cost=15.61..76.61 rows=2,051 width=63) (actual time=1.014..6.107 rows=2,051 loops=1)

  • Hash Cond: (barrio.cod_city = city.id)
31. 1.574 1.574 ↑ 1.0 2,051 1

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

32. 0.271 0.983 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
33. 0.456 0.712 ↑ 1.0 254 1

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

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

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

35. 0.024 0.045 ↑ 1.0 18 1

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

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

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

37.          

SubPlan (forHash Left Join)

38. 65.364 9,792.030 ↑ 1.0 1 2,514

Aggregate (cost=1,394.78..1,394.79 rows=1 width=8) (actual time=3.894..3.895 rows=1 loops=2,514)

39. 9,726.666 9,726.666 ↑ 1.6 16 2,514

Index Scan using inscripcion_alumno_id_alumno_id_planificacion_idx on inscripcion_alumno insxx (cost=0.42..1,394.72 rows=25 width=8) (actual time=1.578..3.869 rows=16 loops=2,514)

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