explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 83.776 12,444.201 ↑ 1.0 2,514 1

Hash Left Join (cost=946.27..3,520,403.77 rows=2,523 width=377) (actual time=62.034..12,444.201 rows=2,514 loops=1)

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

Hash Left Join (cost=930.66..1,262.60 rows=2,523 width=334) (actual time=57.395..158.792 rows=2,514 loops=1)

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

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

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

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

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

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

6. 10.121 44.669 ↑ 1.0 2,514 1

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

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

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

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

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

9. 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
10. 4.433 25.648 ↑ 1.0 2,514 1

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

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

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

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

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

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

Seq Scan on planificacion (cost=0.00..480.24 rows=2,539 width=44) (actual time=0.007..7.164 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.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
15. 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)

16. 1.267 4.193 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
17. 1.591 2.926 ↓ 1.0 885 1

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

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

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

19. 0.061 0.306 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
20. 0.131 0.245 ↑ 1.0 57 1

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

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

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

22. 0.036 0.065 ↑ 1.0 24 1

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

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

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

24. 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
25. 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.003..0.007 rows=4 loops=1)

26. 0.098 0.186 ↑ 1.0 95 1

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

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

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

28. 4.141 8.252 ↓ 1.0 2,996 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 379kB
29. 4.111 4.111 ↓ 1.0 2,996 1

Seq Scan on ubicacion (cost=0.00..88.94 rows=2,994 width=95) (actual time=0.008..4.111 rows=2,996 loops=1)

30. 2.320 4.291 ↓ 1.0 2,050 1

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

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

Seq Scan on barrio (cost=0.00..33.22 rows=2,022 width=20) (actual time=0.008..1.971 rows=2,050 loops=1)

32. 0.312 1.191 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
33. 0.582 0.879 ↑ 1.0 254 1

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

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

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

35. 0.028 0.049 ↑ 1.0 18 1

Hash (cost=1.18..1.18 rows=18 width=19) (actual time=0.049..0.049 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.006..0.021 rows=18 loops=1)

37.          

SubPlan (forHash Left Join)

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

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

39. 12,117.480 12,117.480 ↑ 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.984..4.820 rows=16 loops=2,514)

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