explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eo9X

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 67.999 ↑ 21.0 1 1

HashAggregate (cost=414.25..414.46 rows=21 width=49) (actual time=67.999..67.999 rows=1 loops=1)

  • Group Key: max(disciplina.codigo)
2. 1.212 67.994 ↑ 21.0 1 1

HashAggregate (cost=413.99..414.20 rows=21 width=49) (actual time=67.994..67.994 rows=1 loops=1)

  • Group Key: disciplina.codigo, disciplina.nome, matriculaperiodoturmadisciplina.modalidadedisciplina
3. 1.880 66.782 ↓ 92.2 1,936 1

Nested Loop Left Join (cost=3.13..413.78 rows=21 width=49) (actual time=34.193..66.782 rows=1,936 loops=1)

4. 7.818 61.030 ↓ 92.2 1,936 1

Nested Loop (cost=2.71..236.22 rows=21 width=43) (actual time=34.183..61.030 rows=1,936 loops=1)

  • Join Filter: ((((curso.periodicidade)::text = 'AN'::text) AND ((horarioturma.anovigente)::text = (matriculaperiodo.ano)::text)) OR (((curso.periodicidade)::text = 'SE'::text) AND ((horarioturma.anovigente)::text = (matriculaperiodo.ano)::text) AND ((horarioturma.semestrevigente)::text = (matriculaperiodo.semestre)::text)) OR ((curso.periodicidade)::text = 'IN'::text))
  • Rows Removed by Join Filter: 8051
5. 6.569 33.238 ↓ 50.4 9,987 1

Nested Loop (cost=2.42..170.07 rows=198 width=55) (actual time=0.077..33.238 rows=9,987 loops=1)

6. 3.304 6.695 ↓ 50.4 9,987 1

Nested Loop (cost=1.99..75.03 rows=198 width=55) (actual time=0.070..6.695 rows=9,987 loops=1)

7. 0.003 0.063 ↑ 1.0 1 1

Nested Loop (cost=1.57..33.71 rows=1 width=55) (actual time=0.054..0.063 rows=1 loops=1)

8. 0.000 0.054 ↑ 1.0 1 1

Nested Loop (cost=1.15..25.25 rows=1 width=54) (actual time=0.047..0.054 rows=1 loops=1)

9. 0.003 0.049 ↑ 1.0 1 1

Nested Loop (cost=1.00..25.08 rows=1 width=55) (actual time=0.044..0.049 rows=1 loops=1)

10. 0.004 0.030 ↑ 1.0 1 1

Nested Loop (cost=0.71..16.76 rows=1 width=60) (actual time=0.027..0.030 rows=1 loops=1)

11. 0.021 0.021 ↑ 1.0 1 1

Index Scan using historico_pkey on historico (cost=0.43..8.45 rows=1 width=21) (actual time=0.019..0.021 rows=1 loops=1)

  • Index Cond: (codigo = 2007739)
12. 0.005 0.005 ↑ 1.0 1 1

Index Scan using disciplina_pkey on disciplina (cost=0.28..8.30 rows=1 width=39) (actual time=0.004..0.005 rows=1 loops=1)

  • Index Cond: (codigo = historico.disciplina)
13. 0.016 0.016 ↑ 1.0 1 1

Index Scan using matricula_pkey on matricula (cost=0.29..8.31 rows=1 width=13) (actual time=0.014..0.016 rows=1 loops=1)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
14. 0.005 0.005 ↑ 1.0 1 1

Index Scan using curso_pkey on curso (cost=0.14..0.17 rows=1 width=7) (actual time=0.003..0.005 rows=1 loops=1)

  • Index Cond: (codigo = matricula.curso)
15. 0.006 0.006 ↑ 1.0 1 1

Index Scan using matriculaperiodo_pkey on matriculaperiodo (cost=0.42..8.44 rows=1 width=9) (actual time=0.005..0.006 rows=1 loops=1)

  • Index Cond: (codigo = historico.matriculaperiodo)
16. 3.328 3.328 ↓ 12.7 9,987 1

Index Scan using idx_horturdiaitem_disciplina on horarioturmadiaitem (cost=0.43..33.47 rows=786 width=8) (actual time=0.016..3.328 rows=9,987 loops=1)

  • Index Cond: (disciplina = disciplina.codigo)
17. 19.974 19.974 ↑ 1.0 1 9,987

Index Scan using horarioturmadia_pkey on horarioturmadia (cost=0.42..0.47 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=9,987)

  • Index Cond: (codigo = horarioturmadiaitem.horarioturmadia)
18. 19.974 19.974 ↑ 1.0 1 9,987

Index Scan using horarioturma_pkey on horarioturma (cost=0.29..0.31 rows=1 width=9) (actual time=0.001..0.002 rows=1 loops=9,987)

  • Index Cond: (codigo = horarioturmadia.horarioturma)
19. 3.872 3.872 ↑ 1.0 1 1,936

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina (cost=0.43..8.45 rows=1 width=14) (actual time=0.002..0.002 rows=1 loops=1,936)

  • Index Cond: (codigo = historico.matriculaperiodoturmadisciplina)
Planning time : 11.569 ms
Execution time : 68.231 ms