explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XQSN

Settings
# exclusive inclusive rows x rows loops node
1. 110.981 16,320.879 ↑ 1.0 2,522 1

Hash Left Join (cost=844.66..3,530,947.50 rows=2,524 width=377) (actual time=179.277..16,320.879 rows=2,522 loops=1)

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

Hash Left Join (cost=829.05..1,161.04 rows=2,524 width=334) (actual time=153.156..262.259 rows=2,522 loops=1)

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

Hash Left Join (cost=769.70..1,063.83 rows=2,524 width=320) (actual time=141.184..231.419 rows=2,522 loops=1)

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

Hash Join (cost=643.34..913.26 rows=2,524 width=233) (actual time=123.994..184.540 rows=2,522 loops=1)

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

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

6. 17.275 123.904 ↑ 1.0 2,522 1

Hash (cost=611.79..611.79 rows=2,524 width=201) (actual time=123.904..123.904 rows=2,522 loops=1)

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

Hash Join (cost=108.75..611.79 rows=2,524 width=201) (actual time=21.847..106.629 rows=2,522 loops=1)

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

Nested Loop (cost=104.61..572.94 rows=2,524 width=185) (actual time=21.587..98.438 rows=2,522 loops=1)

9. 0.008 0.008 ↑ 1.0 1 1

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

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

Hash Join (cost=104.61..546.67 rows=2,524 width=189) (actual time=21.576..84.421 rows=2,522 loops=1)

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

Hash Join (cost=103.52..510.87 rows=2,524 width=193) (actual time=21.541..63.542 rows=2,522 loops=1)

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

Hash Join (cost=40.90..413.54 rows=2,527 width=51) (actual time=0.459..27.878 rows=2,525 loops=1)

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

Bitmap Heap Scan on planificacion (cost=39.86..377.70 rows=2,540 width=44) (actual time=0.433..6.765 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.382 0.382 ↓ 1.0 2,817 1

Bitmap Index Scan on planificacion_id_subestado_idx (cost=0.00..39.22 rows=2,792 width=0) (actual time=0.382..0.382 rows=2,817 loops=1)

  • Index Cond: (id_subestado = 2)
15. 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
16. 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)

17. 17.649 21.056 ↓ 1.0 885 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 112kB
18. 1.900 3.407 ↓ 1.0 885 1

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

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

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

20. 0.064 0.307 ↑ 1.0 57 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 5kB
21. 0.149 0.243 ↑ 1.0 57 1

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

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

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

23. 0.027 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
24. 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.003..0.024 rows=24 loops=1)

25. 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
26. 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)

27. 0.116 0.216 ↑ 1.0 95 1

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

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

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

29. 6.076 17.154 ↓ 1.0 3,005 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 380kB
30. 11.078 11.078 ↓ 1.0 3,005 1

Seq Scan on ubicacion (cost=0.00..88.94 rows=2,994 width=95) (actual time=0.005..11.078 rows=3,005 loops=1)

31. 7.672 11.934 ↑ 1.0 2,060 1

Hash (cost=33.60..33.60 rows=2,060 width=20) (actual time=11.934..11.934 rows=2,060 loops=1)

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

Seq Scan on barrio (cost=0.00..33.60 rows=2,060 width=20) (actual time=0.008..4.262 rows=2,060 loops=1)

33. 0.295 1.033 ↑ 1.0 254 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 21kB
34. 0.481 0.738 ↑ 1.0 254 1

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

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

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

36. 0.024 0.043 ↑ 1.0 18 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 1kB
37. 0.019 0.019 ↑ 1.0 18 1

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

38.          

SubPlan (forHash Left Join)

39. 105.924 15,946.606 ↑ 1.0 1 2,522

Aggregate (cost=1,398.44..1,398.45 rows=1 width=8) (actual time=6.318..6.323 rows=1 loops=2,522)

40. 15,840.682 15,840.682 ↑ 1.6 16 2,522

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

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