explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GZUh : Optimization for: plan #n2L3

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 95.207 14,043.536 ↑ 1.0 2,514 1

Hash Left Join (cost=946.64..3,527,378.32 rows=2,528 width=377) (actual time=144.609..14,043.536 rows=2,514 loops=1)

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

Hash Left Join (cost=931.03..1,263.06 rows=2,528 width=334) (actual time=118.067..200.625 rows=2,514 loops=1)

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

Hash Left Join (cost=872.53..1,166.65 rows=2,528 width=320) (actual time=113.617..180.618 rows=2,514 loops=1)

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

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

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

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

6. 9.684 97.555 ↑ 1.0 2,514 1

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

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

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

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

Nested Loop (cost=64.75..675.67 rows=2,528 width=185) (actual time=10.092..76.603 rows=2,514 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. 8.395 67.609 ↑ 1.0 2,514 1

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

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

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

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

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

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

Seq Scan on planificacion (cost=0.00..480.22 rows=2,544 width=44) (actual time=0.011..21.251 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.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
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.128 10.007 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
17. 7.630 8.879 ↓ 1.0 885 1

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

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

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

19. 0.065 0.290 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
20. 0.129 0.225 ↑ 1.0 57 1

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

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

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

22. 0.028 0.051 ↑ 1.0 24 1

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

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

24. 0.004 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
25. 0.008 0.008 ↑ 1.0 4 1

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

26. 0.116 0.209 ↑ 1.0 95 1

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

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

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

28. 5.817 15.907 ↑ 1.0 2,994 1

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

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

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

30. 2.306 4.407 ↓ 1.0 2,050 1

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

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

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

32. 0.319 1.152 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
33. 0.563 0.833 ↑ 1.0 254 1

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

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

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

35. 0.024 0.047 ↑ 1.0 18 1

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

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

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

37.          

SubPlan (forHash Left Join)

38. 80.448 13,746.552 ↑ 1.0 1 2,514

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

39. 13,666.104 13,666.104 ↑ 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.211..5.436 rows=16 loops=2,514)

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