explain.depesz.com

PostgreSQL's explain analyze made readable

Result: T4uE

Settings
# exclusive inclusive rows x rows loops node
1. 100.934 22,359.877 ↑ 1.0 2,522 1

Hash Left Join (cost=845.12..3,540,899.91 rows=2,526 width=377) (actual time=121.662..22,359.877 rows=2,522 loops=1)

  • Hash Cond: (barrio.cod_city = city.id)
2. 17.616 175.125 ↑ 1.0 2,522 1

Hash Left Join (cost=829.51..1,161.59 rows=2,526 width=334) (actual time=76.803..175.125 rows=2,522 loops=1)

  • Hash Cond: (ubicacion.id_barrio = barrio.id_barrio)
3. 16.658 151.291 ↑ 1.0 2,522 1

Hash Left Join (cost=770.05..1,064.24 rows=2,526 width=320) (actual time=70.546..151.291 rows=2,522 loops=1)

  • Hash Cond: (planificacion.id_ubicacion = ubicacion.id_ubicacion)
4. 42.536 115.714 ↑ 1.0 2,522 1

Hash Join (cost=643.68..913.62 rows=2,526 width=233) (actual time=51.584..115.714 rows=2,522 loops=1)

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

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

6. 8.159 51.435 ↑ 1.0 2,522 1

Hash (cost=612.11..612.11 rows=2,526 width=201) (actual time=51.435..51.435 rows=2,522 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 440kB
7. 4.918 43.276 ↑ 1.0 2,522 1

Hash Join (cost=108.80..612.11 rows=2,526 width=201) (actual time=12.487..43.276 rows=2,522 loops=1)

  • Hash Cond: (planificacion.id_unidad_operativa = unidad_operativa.id_unidad_operativa)
8. 3.854 38.108 ↑ 1.0 2,522 1

Nested Loop (cost=104.66..573.24 rows=2,526 width=185) (actual time=12.192..38.108 rows=2,522 loops=1)

9. 0.036 0.036 ↑ 1.0 1 1

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

  • Filter: (id_subestado = 2)
  • Rows Removed by Filter: 2
10. 4.475 34.218 ↑ 1.0 2,522 1

Hash Join (cost=104.66..546.94 rows=2,526 width=189) (actual time=12.152..34.218 rows=2,522 loops=1)

  • Hash Cond: (planificacion.id_estado = estado_planificacion.id_estado)
11. 5.300 29.729 ↑ 1.0 2,522 1

Hash Join (cost=103.57..511.12 rows=2,526 width=193) (actual time=12.112..29.729 rows=2,522 loops=1)

  • Hash Cond: (planificacion.id_especialiadad = especialidades.id_especialidades)
12. 4.640 13.023 ↑ 1.0 2,525 1

Hash Join (cost=40.96..413.76 rows=2,529 width=51) (actual time=0.642..13.023 rows=2,525 loops=1)

  • Hash Cond: (planificacion.id_modalidad = modalidad.id_modalidad)
13. 7.837 8.371 ↑ 1.0 2,535 1

Bitmap Heap Scan on planificacion (cost=39.91..377.89 rows=2,542 width=44) (actual time=0.606..8.371 rows=2,535 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.534 0.534 ↑ 1.0 2,799 1

Bitmap Index Scan on planificacion_id_subestado_idx (cost=0.00..39.28 rows=2,799 width=0) (actual time=0.534..0.534 rows=2,799 loops=1)

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

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

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

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

17. 1.195 11.406 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
18. 3.604 10.211 ↓ 1.0 885 1

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

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

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

20. 0.063 0.374 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
21. 0.128 0.311 ↑ 1.0 57 1

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

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

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

23. 0.096 0.127 ↑ 1.0 24 1

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

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

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

25. 0.005 0.014 ↑ 1.0 4 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
26. 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.004..0.009 rows=4 loops=1)

27. 0.119 0.250 ↑ 1.0 95 1

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

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

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

29. 11.872 18.919 ↓ 1.0 3,011 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 381kB
30. 7.047 7.047 ↓ 1.0 3,011 1

Seq Scan on ubicacion (cost=0.00..88.94 rows=2,994 width=95) (actual time=0.006..7.047 rows=3,011 loops=1)

31. 3.996 6.218 ↑ 1.0 2,065 1

Hash (cost=33.65..33.65 rows=2,065 width=20) (actual time=6.218..6.218 rows=2,065 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 108kB
32. 2.222 2.222 ↑ 1.0 2,065 1

Seq Scan on barrio (cost=0.00..33.65 rows=2,065 width=20) (actual time=0.011..2.222 rows=2,065 loops=1)

33. 0.290 6.230 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
34. 0.501 5.940 ↑ 1.0 254 1

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

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

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

36. 0.021 0.042 ↑ 1.0 18 1

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

38.          

SubPlan (forHash Left Join)

39. 103.402 22,077.588 ↑ 1.0 1 2,522

Aggregate (cost=1,401.28..1,401.29 rows=1 width=8) (actual time=8.753..8.754 rows=1 loops=2,522)

40. 21,974.186 21,974.186 ↑ 1.6 16 2,522

Index Scan using inscripcion_alumno_id_alumno_id_planificacion_idx on inscripcion_alumno insxx (cost=0.42..1,401.21 rows=25 width=8) (actual time=3.599..8.713 rows=16 loops=2,522)

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