explain.depesz.com

PostgreSQL's explain analyze made readable

Result: n2L3

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 79.227 12,934.147 ↑ 1.0 2,514 1

Hash Left Join (cost=947.04..3,527,378.73 rows=2,528 width=377) (actual time=137.989..12,934.147 rows=2,514 loops=1)

  • Hash Cond: (barrio.cod_city = city.id)
2. 14.109 210.008 ↑ 1.0 2,514 1

Hash Left Join (cost=931.43..1,263.47 rows=2,528 width=334) (actual time=119.738..210.008 rows=2,514 loops=1)

  • Hash Cond: (ubicacion.id_barrio = barrio.id_barrio)
3. 20.085 180.958 ↑ 1.0 2,514 1

Hash Left Join (cost=872.94..1,167.05 rows=2,528 width=320) (actual time=104.751..180.958 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_ubicacion = ubicacion.id_ubicacion)
4. 41.835 139.758 ↑ 1.0 2,514 1

Hash Join (cost=746.17..1,016.11 rows=2,528 width=233) (actual time=83.585..139.758 rows=2,514 loops=1)

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

Seq Scan on periodo (cost=0.00..195.11 rows=9,911 width=36) (actual time=0.029..14.501 rows=9,912 loops=1)

6. 4.908 83.422 ↑ 1.0 2,514 1

Hash (cost=714.57..714.57 rows=2,528 width=201) (actual time=83.422..83.422 rows=2,514 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 438kB
7. 8.284 78.514 ↑ 1.0 2,514 1

Hash Join (cost=68.89..714.57 rows=2,528 width=201) (actual time=5.041..78.514 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_unidad_operativa = unidad_operativa.id_unidad_operativa)
8. 6.876 69.989 ↑ 1.0 2,514 1

Nested Loop (cost=64.75..675.67 rows=2,528 width=185) (actual time=4.757..69.989 rows=2,514 loops=1)

9. 0.038 0.038 ↑ 1.0 1 1

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

  • Filter: (id_subestado = 2)
  • Rows Removed by Filter: 2
10. 6.240 63.075 ↑ 1.0 2,514 1

Hash Join (cost=64.75..649.35 rows=2,528 width=189) (actual time=4.718..63.075 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_estado = estado_planificacion.id_estado)
11. 9.953 56.820 ↑ 1.0 2,514 1

Hash Join (cost=63.66..613.50 rows=2,528 width=193) (actual time=4.678..56.820 rows=2,514 loops=1)

  • Hash Cond: (planificacion.id_especialiadad = especialidades.id_especialidades)
12. 4.782 42.293 ↑ 1.0 2,517 1

Hash Join (cost=1.04..516.12 rows=2,531 width=51) (actual time=0.054..42.293 rows=2,517 loops=1)

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

Seq Scan on planificacion (cost=0.00..480.22 rows=2,544 width=44) (actual time=0.023..37.500 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
14. 0.005 0.011 ↑ 1.0 2 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
15. 0.006 0.006 ↑ 1.0 2 1

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

16. 1.265 4.574 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
17. 1.724 3.309 ↓ 1.0 885 1

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

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

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

19. 0.081 0.313 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
20. 0.134 0.232 ↑ 1.0 57 1

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

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

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

22. 0.028 0.052 ↑ 1.0 24 1

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

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

24. 0.006 0.015 ↑ 1.0 4 1

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

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

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

26. 0.127 0.241 ↑ 1.0 95 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 6kB
27. 0.114 0.114 ↑ 1.0 95 1

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

28. 6.614 21.115 ↑ 1.0 2,993 1

Hash (cost=89.12..89.12 rows=3,012 width=95) (actual time=21.115..21.115 rows=2,993 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 379kB
29. 14.501 14.501 ↑ 1.0 2,993 1

Seq Scan on ubicacion (cost=0.00..89.12 rows=3,012 width=95) (actual time=0.008..14.501 rows=2,993 loops=1)

30. 9.215 14.941 ↓ 1.0 2,049 1

Hash (cost=33.22..33.22 rows=2,022 width=20) (actual time=14.941..14.941 rows=2,049 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 107kB
31. 5.726 5.726 ↓ 1.0 2,049 1

Seq Scan on barrio (cost=0.00..33.22 rows=2,022 width=20) (actual time=0.012..5.726 rows=2,049 loops=1)

32. 0.302 4.520 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
33. 3.662 4.218 ↑ 1.0 254 1

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

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

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

35. 0.266 0.293 ↑ 1.0 18 1

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

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

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

37.          

SubPlan (forHash Left Join)

38. 82.962 12,640.392 ↑ 1.0 1 2,514

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

39. 12,557.430 12,557.430 ↑ 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=2.052..4.995 rows=16 loops=2,514)

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