explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b4N9

Settings
# exclusive inclusive rows x rows loops node
1. 0.013 2,611.670 ↑ 1.0 1 1

Aggregate (cost=20,376.75..20,376.76 rows=1 width=32) (actual time=2,611.161..2,611.670 rows=1 loops=1)

2. 0.011 2,611.657 ↓ 7.0 7 1

Unique (cost=20,376.69..20,376.73 rows=1 width=546) (actual time=2,611.137..2,611.657 rows=7 loops=1)

3. 0.035 2,611.646 ↓ 7.0 7 1

Sort (cost=20,376.69..20,376.69 rows=1 width=546) (actual time=2,611.136..2,611.646 rows=7 loops=1)

  • Sort Key: atividadediscursiva.codigo, atividadediscursiva.datalimiteentrega, atividadediscursiva.enunciado, turma.codigo, turma.identificadorturma, disciplina.codigo, disciplina.nome, atividadediscursiva.ano, atividadediscursiva.semestre, (count("*SELECT* 1".matriculaperiodoturmadisciplina)), (sum(CASE WHEN ((atividadediscursivarespostaaluno.situacaorespostaatividadediscursiva)::text = 'AGUARDANDO_AVALIACAO_PROFESSOR'::text) THEN 1 ELSE 0 END)), (sum(CASE WHEN ((atividadediscursivarespostaaluno.situacaorespostaatividadediscursiva)::text = 'AGUARDANDO_NOVA_RESPOSTA'::text) THEN 1 ELSE 0 END)), (sum(CASE WHEN ((atividadediscursivarespostaaluno.situacaorespostaatividadediscursiva)::text = 'AVALIADO'::text) THEN 1 ELSE 0 END)), (sum(CASE WHEN (((atividadediscursivarespostaaluno.codigo IS NULL) AND ("*SELECT* 1".matriculaperiodoturmadisciplina IS NOT NULL)) OR ((atividadediscursivarespostaaluno.situacaorespostaatividadediscursiva)::text = 'AGUARDANDO_RESPOSTA'::text)) THEN 1 ELSE 0 END)), (sum(CASE WHEN (alternatives: SubPlan 1 or hashed SubPlan 2) THEN 1 ELSE 0 END)), (min(atividadediscursivarespostaaluno.datalimiteentrega))
  • Sort Method: quicksort Memory: 32kB
4. 0.613 2,611.611 ↓ 7.0 7 1

GroupAggregate (cost=20,374.13..20,376.68 rows=1 width=546) (actual time=2,610.580..2,611.611 rows=7 loops=1)

  • Group Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
5. 0.699 2,610.998 ↓ 497.0 497 1

Sort (cost=20,374.13..20,374.13 rows=1 width=527) (actual time=2,610.447..2,610.998 rows=497 loops=1)

  • Sort Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
  • Sort Method: quicksort Memory: 529kB
6. 0.319 2,610.299 ↓ 497.0 497 1

Nested Loop Left Join (cost=107.78..20,374.12 rows=1 width=527) (actual time=1,116.499..2,610.299 rows=497 loops=1)

  • Join Filter: (atividadediscursivarespostaaluno.matriculaperiodoturmadisciplina = "*SELECT* 1".matriculaperiodoturmadisciplina)
  • Rows Removed by Join Filter: 757
7. 1.223 2,608.986 ↓ 497.0 497 1

Nested Loop Left Join (cost=107.50..20,372.66 rows=1 width=494) (actual time=1,116.478..2,608.986 rows=497 loops=1)

  • Join Filter: ((((atividadediscursiva.publicoalvo)::text = 'TURMA'::text) AND ("*SELECT* 1".turmaprogramada = atividadediscursiva.turma) AND ("*SELECT* 1".disciplinaprogramada = atividadediscursiva.disciplina) AND (("*SELECT* 1".ano)::text = (atividadediscursiva.ano)::text) AND (("*SELECT* 1".semestre)::text = (atividadediscursiva.semestre)::text)) OR (((atividadediscursiva.publicoalvo)::text = 'ALUNO'::text) AND (atividadediscursiva.matriculaperiodoturmadisciplina = "*SELECT* 1".matriculaperiodoturmadisciplina)))
  • Rows Removed by Join Filter: 3,157
8. 1.003 1,016.383 ↓ 7.0 7 1

Nested Loop (cost=59.63..434.98 rows=1 width=508) (actual time=1,003.122..1,016.383 rows=7 loops=1)

9. 0.843 3.285 ↑ 1.0 459 1

Nested Loop (cost=0.55..354.04 rows=459 width=474) (actual time=0.044..3.285 rows=459 loops=1)

10. 0.606 0.606 ↑ 1.0 459 1

Index Scan using atividadediscursiva_pkey on atividadediscursiva (cost=0.27..44.74 rows=459 width=445) (actual time=0.022..0.606 rows=459 loops=1)

11. 1.836 1.836 ↑ 1.0 1 459

Index Scan using turma_pkey on turma (cost=0.28..0.67 rows=1 width=29) (actual time=0.004..0.004 rows=1 loops=459)

  • Index Cond: (codigo = atividadediscursiva.turma)
12. 1.836 1,012.095 ↓ 0.0 0 459

Hash Join (cost=59.08..59.11 rows=1 width=47) (actual time=2.205..2.205 rows=0 loops=459)

  • Hash Cond: (horarioprofessor.disciplina = disciplina.codigo)
  • Join Filter: (((atividadediscursiva.ano)::text = (horarioprofessor.ano)::text) AND ((atividadediscursiva.semestre)::text = (horarioprofessor.semestre)::text) AND (atividadediscursiva.disciplina = horarioprofessor.disciplina))
13. 0.459 1,007.505 ↓ 0.0 0 459

Subquery Scan on horarioprofessor (cost=58.70..58.74 rows=1 width=13) (actual time=2.194..2.195 rows=0 loops=459)

  • Filter: (turma.codigo = horarioprofessor.turma)
14. 0.459 1,007.046 ↓ 0.0 0 459

Unique (cost=58.70..58.73 rows=1 width=69) (actual time=2.194..2.194 rows=0 loops=459)

15. 2.295 1,006.587 ↑ 1.0 1 459

Sort (cost=58.70..58.71 rows=1 width=69) (actual time=2.193..2.193 rows=1 loops=459)

  • Sort Key: horarioturma.codigo, t.subturma, t.tiposubturma, t.turmaagrupada, horarioturmadiaitem.disciplina, horarioturma.anovigente, horarioturma.semestrevigente
  • Sort Method: quicksort Memory: 25kB
16. 1.377 1,004.292 ↑ 1.0 1 459

Nested Loop (cost=1.40..58.69 rows=1 width=69) (actual time=2.185..2.188 rows=1 loops=459)

  • Join Filter: ((t.semestral AND ((horarioturma.anovigente)::text = '2020'::text) AND ((horarioturma.semestrevigente)::text = '2'::text)) OR (t.anual AND ((horarioturma.anovigente)::text = '2020'::text)) OR ((NOT t.semestral) AND (NOT t.anual) AND (horarioturmadiaitem.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 8
17. 1.377 1.377 ↑ 1.0 1 459

Index Scan using turma_pkey on turma t (cost=0.28..2.50 rows=1 width=14) (actual time=0.002..0.003 rows=1 loops=459)

  • Index Cond: (codigo = turma.codigo)
  • Filter: (semestral OR anual OR ((NOT semestral) AND (NOT anual)))
18. 0.000 1,001.538 ↓ 2.2 9 459

Nested Loop (cost=1.12..56.09 rows=4 width=25) (actual time=1.968..2.182 rows=9 loops=459)

19. 15.275 189.108 ↓ 2.0 137 459

Nested Loop (cost=0.70..16.61 rows=69 width=17) (actual time=0.168..0.412 rows=137 loops=459)

20. 2.295 2.295 ↑ 1.0 2 459

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma (cost=0.28..3.24 rows=2 width=13) (actual time=0.004..0.005 rows=2 loops=459)

  • Index Cond: (turma = turma.codigo)
21. 171.538 171.538 ↓ 1.9 73 862

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia (cost=0.42..6.31 rows=38 width=8) (actual time=0.090..0.199 rows=73 loops=862)

  • Index Cond: (horarioturma = horarioturma.codigo)
22. 817.349 817.349 ↓ 0.0 0 62,873

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem (cost=0.42..0.56 rows=1 width=16) (actual time=0.013..0.013 rows=0 loops=62,873)

  • Index Cond: (horarioturmadia = horarioturmadia.codigo)
  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 4
23. 0.918 2.754 ↑ 1.0 1 459

Hash (cost=0.36..0.36 rows=1 width=34) (actual time=0.006..0.006 rows=1 loops=459)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
24. 1.836 1.836 ↑ 1.0 1 459

Index Scan using disciplina_pkey on disciplina (cost=0.28..0.36 rows=1 width=34) (actual time=0.004..0.004 rows=1 loops=459)

  • Index Cond: (codigo = atividadediscursiva.disciplina)
25. 0.448 1,591.380 ↓ 130.5 522 7

Append (cost=47.87..19,937.57 rows=4 width=17) (actual time=39.101..227.340 rows=522 loops=7)

26. 0.007 165.137 ↓ 0.0 0 7

Subquery Scan on *SELECT* 1 (cost=47.87..145.17 rows=1 width=17) (actual time=23.589..23.591 rows=0 loops=7)

27. 0.000 165.130 ↓ 0.0 0 7

Nested Loop (cost=47.87..145.16 rows=1 width=155) (actual time=23.588..23.590 rows=0 loops=7)

28. 1.246 165.130 ↓ 0.0 0 7

Nested Loop (cost=47.45..143.62 rows=1 width=21) (actual time=23.588..23.590 rows=0 loops=7)

  • Join Filter: (((curso.periodicidade)::text = 'IN'::text) OR (((curso.periodicidade)::text = 'AN'::text) AND ((matriculaperiodoturmadisciplina.ano)::text = '2020'::text)) OR (((curso.periodicidade)::text = 'SE'::text) AND ((matriculaperiodoturmadisciplina.ano)::text = '2020'::text) AND ((matriculaperiodoturmadisciplina.semestre)::text = '2'::text)))
  • Rows Removed by Join Filter: 152
29. 1.414 89.404 ↓ 152.0 152 7

Nested Loop (cost=47.17..143.29 rows=1 width=25) (actual time=0.147..12.772 rows=152 loops=7)

  • Join Filter: (((matricula.gradecurricularatual = historico.matrizcurricular) AND ((historico.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico.transferenciamatrizcurricularmatricula IS NULL) OR ((historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 3))))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicocursandoporcorrespondenciaapostransferencia AND (historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 4) AND ((NOT historico.historicoporequivalencia) OR (historico.historicoporequivalencia IS NULL))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicoequivalente AND (SubPlan 5)) OR ((historico.matrizcurricular = matriculaperiodo.gradecurricular) AND (matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 6))))
  • Rows Removed by Join Filter: 4
30. 1.827 82.530 ↓ 156.0 156 7

Nested Loop (cost=46.75..82.15 rows=1 width=45) (actual time=0.131..11.790 rows=156 loops=7)

31. 1.043 75.243 ↓ 156.0 156 7

Nested Loop (cost=46.46..81.83 rows=1 width=49) (actual time=0.118..10.749 rows=156 loops=7)

32. 0.504 70.924 ↓ 156.0 156 7

Nested Loop (cost=46.17..80.68 rows=1 width=37) (actual time=0.108..10.132 rows=156 loops=7)

33. 0.091 0.532 ↑ 1.0 13 7

Unique (cost=45.74..46.03 rows=13 width=92) (actual time=0.059..0.076 rows=13 loops=7)

34. 0.064 0.441 ↑ 1.0 13 7

Sort (cost=45.74..45.77 rows=13 width=92) (actual time=0.059..0.063 rows=13 loops=7)

  • Sort Key: programacaotutoriaonlineprofessor.codigo, programacaotutoriaonline.turma, t_1.subturma, t_1.tiposubturma, t_1.turmaagrupada, programacaotutoriaonline.disciplina, programacaotutoriaonline.ano, programacaotutoriaonline.semestre
  • Sort Method: quicksort Memory: 26kB
35. 0.022 0.377 ↑ 1.0 13 1

Nested Loop Left Join (cost=0.56..45.50 rows=13 width=92) (actual time=0.195..0.377 rows=13 loops=1)

36. 0.027 0.303 ↑ 1.0 13 1

Nested Loop (cost=0.28..39.29 rows=13 width=44) (actual time=0.174..0.303 rows=13 loops=1)

37. 0.224 0.224 ↑ 1.0 13 1

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..20.09 rows=13 width=12) (actual time=0.156..0.224 rows=13 loops=1)

  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 954
38. 0.052 0.052 ↑ 1.0 1 13

Index Scan using programacaotutoriaonline_pkey on programacaotutoriaonline (cost=0.28..1.48 rows=1 width=40) (actual time=0.004..0.004 rows=1 loops=13)

  • Index Cond: (codigo = programacaotutoriaonlineprofessor.programacaotutoriaonline)
39. 0.052 0.052 ↑ 1.0 1 13

Index Scan using turma_pkey on turma t_1 (cost=0.28..0.48 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=13)

  • Index Cond: (codigo = programacaotutoriaonline.turma)
40. 69.888 69.888 ↓ 12.0 12 91

Index Scan using idx_mptd_programacaotutoriaonlineprofessor on matriculaperiodoturmadisciplina (cost=0.42..2.64 rows=1 width=37) (actual time=0.004..0.768 rows=12 loops=91)

  • Index Cond: ((programacaotutoriaonlineprofessor = programacaotutoriaonlineprofessor.codigo) AND (programacaotutoriaonlineprofessor IS NOT NULL))
41. 3.276 3.276 ↑ 1.0 1 1,092

Index Scan using matriculaperiodo_pkey on matriculaperiodo (cost=0.29..1.15 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=1,092)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.matriculaperiodo)
42. 5.460 5.460 ↑ 1.0 1 1,092

Index Scan using matricula_pkey on matricula (cost=0.29..0.32 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=1,092)

  • Index Cond: ((matricula)::text = (matriculaperiodo.matricula)::text)
43. 5.460 5.460 ↑ 1.0 1 1,092

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.42..2.29 rows=1 width=49) (actual time=0.005..0.005 rows=1 loops=1,092)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina.codigo)
  • Filter: (((((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((transferenciamatrizcurricularmatricula IS NULL) OR (transferenciamatrizcurricularmatricula IS NOT NULL))) OR (historicocursandoporcorrespondenciaapostransferencia AND (transferenciamatrizcurricularmatricula IS NOT NULL) AND ((NOT historicoporequivalencia) OR (historicoporequivalencia IS NULL))) OR historicoequivalente OR historicodisciplinafazpartecomposicao) AND ((matriculaperiodoturmadisciplina.matricula)::text = (matricula)::text))
44.          

SubPlan (for Nested Loop)

45. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..21.49 rows=1 width=4) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his (cost=0.42..21.49 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula.gradecurricularatual) AND ((anohistorico)::text = (historico.anohistorico)::text) AND ((semestrehistorico)::text = (historico.semestrehistorico)::text) AND (disciplina = historico.disciplina) AND (transferenciamatrizcurricularmatricula = historico.transferenciamatrizcurricularmatricula))
47. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..20.56 rows=1 width=4) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_1 (cost=0.42..20.56 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico.disciplina) AND (matrizcurricular = matricula.gradecurricularatual))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((matricula)::text = (historico.matricula)::text) AND ((anohistorico)::text = (historico.anohistorico)::text) AND ((semestrehistorico)::text = (historico.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico.transferenciamatrizcurricularmatricula))
49. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.89..35.84 rows=1 width=0) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist (cost=0.42..21.23 rows=1 width=25) (never executed)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico.numeroagrupamentoequivalenciadisciplina))
51. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_2 (cost=13.47..14.59 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico.matricula)::text) AND (disciplina = hist.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula.gradecurricularatual) AND ((hist.anohistorico)::text = (anohistorico)::text) AND ((hist.semestrehistorico)::text = (semestrehistorico)::text) AND (hist.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
52. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=13.47..13.47 rows=1 width=0) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_historico_matricula_gradedisciplina (cost=0.00..1.78 rows=34 width=0) (never executed)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
54. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.44 rows=1,028 width=0) (never executed)

  • Index Cond: (disciplina = hist.disciplina)
55. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_3 (cost=0.42..2.65 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico.disciplina) AND (matriculaperiodo = historico.matriculaperiodo) AND (matrizcurricular = matricula.gradecurricularatual))
  • Heap Fetches: 0
56. 74.480 74.480 ↑ 1.0 1 1,064

Index Scan using curso_pkey on curso (cost=0.28..0.30 rows=1 width=6) (actual time=0.070..0.070 rows=1 loops=1,064)

  • Index Cond: (codigo = matricula.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
57. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa professor (cost=0.42..1.54 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
58. 0.567 1,267.217 ↓ 522.0 522 7

Subquery Scan on *SELECT* 2 (cost=7,157.75..17,830.54 rows=1 width=17) (actual time=15.510..181.031 rows=522 loops=7)

59. 0.574 1,266.650 ↓ 522.0 522 7

Nested Loop (cost=7,157.75..17,830.53 rows=1 width=155) (actual time=15.509..180.950 rows=522 loops=7)

60. 1.848 1,258.768 ↓ 522.0 522 7

Nested Loop (cost=7,157.33..17,828.98 rows=1 width=21) (actual time=15.497..179.824 rows=522 loops=7)

  • Join Filter: (((curso_1.periodicidade)::text = 'IN'::text) OR (((curso_1.periodicidade)::text = 'AN'::text) AND ((matriculaperiodoturmadisciplina_1.ano)::text = '2020'::text)) OR (((curso_1.periodicidade)::text = 'SE'::text) AND ((matriculaperiodoturmadisciplina_1.ano)::text = '2020'::text) AND ((matriculaperiodoturmadisciplina_1.semestre)::text = '2'::text)))
61. 4.263 1,249.612 ↓ 522.0 522 7

Nested Loop (cost=7,157.06..17,828.66 rows=1 width=25) (actual time=15.488..178.516 rows=522 loops=7)

  • Join Filter: (((matricula_1.gradecurricularatual = historico_1.matrizcurricular) AND ((historico_1.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_1.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_1.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 7))))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicocursandoporcorrespondenciaapostransferencia AND (historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 8) AND ((NOT historico_1.historicoporequivalencia) OR (historico_1.historicoporequivalencia IS NULL))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicoequivalente AND (SubPlan 9)) OR ((historico_1.matrizcurricular = matriculaperiodo_1.gradecurricular) AND (matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 10))))
62. 5.684 1,230.733 ↓ 522.0 522 7

Nested Loop (cost=7,156.63..17,769.29 rows=1 width=45) (actual time=15.473..175.819 rows=522 loops=7)

63. 4.046 1,148.315 ↓ 522.0 522 7

Nested Loop (cost=7,156.34..17,768.97 rows=1 width=49) (actual time=15.460..164.045 rows=522 loops=7)

64. 0.749 1,136.961 ↓ 522.0 522 7

Nested Loop (cost=7,156.05..17,768.66 rows=1 width=37) (actual time=15.450..162.423 rows=522 loops=7)

65. 0.063 1,125.607 ↑ 43.1 15 7

Append (cost=7,155.62..16,143.80 rows=646 width=25) (actual time=15.428..160.801 rows=15 loops=7)

66. 0.028 108.710 ↑ 114.8 5 7

Subquery Scan on *SELECT* 1_1 (cost=7,155.62..7,174.28 rows=574 width=25) (actual time=15.427..15.530 rows=5 loops=7)

67. 0.273 108.682 ↑ 114.8 5 7

Unique (cost=7,155.62..7,168.54 rows=574 width=69) (actual time=15.425..15.526 rows=5 loops=7)

68. 0.244 108.409 ↑ 7.7 75 7

Sort (cost=7,155.62..7,157.06 rows=574 width=69) (actual time=15.424..15.487 rows=75 loops=7)

  • Sort Key: horarioturma_1.codigo, t_2.codigo, t_2.subturma, t_2.tiposubturma, t_2.turmaagrupada, horarioturmadiaitem_1.disciplina, horarioturma_1.anovigente, horarioturma_1.semestrevigente
  • Sort Method: quicksort Memory: 35kB
69. 45.721 108.165 ↑ 7.7 75 1

Gather (cost=1,409.74..7,129.32 rows=574 width=69) (actual time=14.470..108.165 rows=75 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
70. 0.793 62.444 ↑ 9.6 25 3 / 3

Hash Join (cost=409.74..6,071.92 rows=239 width=69) (actual time=31.759..62.444 rows=25 loops=3)

  • Hash Cond: (horarioturma_1.turma = t_2.codigo)
  • Join Filter: ((t_2.semestral AND ((horarioturma_1.anovigente)::text = '2020'::text) AND ((horarioturma_1.semestrevigente)::text = '2'::text)) OR (t_2.anual AND ((horarioturma_1.anovigente)::text = '2020'::text)) OR ((NOT t_2.semestral) AND (NOT t_2.anual) AND (horarioturmadiaitem_1.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 1,308
71. 1.089 35.432 ↑ 1.3 2,163 3 / 3

Hash Join (cost=162.70..5,817.63 rows=2,760 width=25) (actual time=1.984..35.432 rows=2,163 loops=3)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
72. 2.144 32.812 ↑ 1.3 2,163 3 / 3

Nested Loop (cost=72.94..5,720.62 rows=2,760 width=16) (actual time=0.361..32.812 rows=2,163 loops=3)

73. 26.094 26.341 ↑ 1.3 2,163 3 / 3

Parallel Bitmap Heap Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=72.65..4,000.47 rows=2,760 width=16) (actual time=0.344..26.341 rows=2,163 loops=3)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=869
74. 0.247 0.247 ↑ 1.0 6,490 1 / 3

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..71.00 rows=6,623 width=0) (actual time=0.742..0.742 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
75. 4.327 4.327 ↑ 1.0 1 6,490 / 3

Index Scan using horarioturmadia_pkey on horarioturmadia horarioturmadia_1 (cost=0.29..0.62 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=6,490)

  • Index Cond: (codigo = horarioturmadiaitem_1.horarioturmadia)
76. 0.737 1.531 ↑ 1.0 2,967 3 / 3

Hash (cost=52.67..52.67 rows=2,967 width=13) (actual time=1.531..1.531 rows=2,967 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 170kB
77. 0.794 0.794 ↑ 1.0 2,967 3 / 3

Seq Scan on horarioturma horarioturma_1 (cost=0.00..52.67 rows=2,967 width=13) (actual time=0.025..0.794 rows=2,967 loops=3)

78. 0.691 26.219 ↑ 1.0 3,885 2 / 3

Hash (cost=196.53..196.53 rows=4,041 width=14) (actual time=39.328..39.329 rows=3,885 loops=2)

  • Buckets: 4,096 Batches: 1 Memory Usage: 207kB
79. 25.528 25.528 ↑ 1.0 3,885 2 / 3

Seq Scan on turma t_2 (cost=0.00..196.53 rows=4,041 width=14) (actual time=0.073..38.292 rows=3,885 loops=2)

  • Filter: ((NOT turmaagrupada) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 1,968
80. 0.042 910.497 ↑ 5.7 10 7

Subquery Scan on *SELECT* 2_1 (cost=4,916.66..4,918.65 rows=57 width=25) (actual time=129.806..130.071 rows=10 loops=7)

81. 1.603 910.455 ↑ 5.7 10 7

Unique (cost=4,916.66..4,918.08 rows=57 width=69) (actual time=129.805..130.065 rows=10 loops=7)

82. 1.224 908.852 ↓ 8.4 480 7

Sort (cost=4,916.66..4,916.80 rows=57 width=69) (actual time=129.804..129.836 rows=480 loops=7)

  • Sort Key: horarioturma_2.codigo, turmaagrupada.turma, t_3.subturma, t_3.tiposubturma, t_3.turmaagrupada, horarioturmadiaitem_2.disciplina, horarioturma_2.anovigente, horarioturma_2.semestrevigente, horarioturma_2.turma
  • Sort Method: quicksort Memory: 92kB
83. 175.695 907.628 ↓ 8.4 480 1

Nested Loop (cost=266.46..4,915.00 rows=57 width=69) (actual time=296.718..907.628 rows=480 loops=1)

  • Join Filter: ((t_3.semestral AND ((horarioturma_2.anovigente)::text = '2020'::text) AND ((horarioturma_2.semestrevigente)::text = '2'::text)) OR (t_3.anual AND ((horarioturma_2.anovigente)::text = '2020'::text)) OR ((NOT t_3.semestral) AND (NOT t_3.anual) AND (horarioturmadiaitem_2.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 10,572
84. 19.472 56.533 ↓ 8.8 61,400 1

Nested Loop (cost=266.04..798.38 rows=7,010 width=31) (actual time=3.818..56.533 rows=61,400 loops=1)

85. 3.382 7.919 ↓ 24.0 4,857 1

Hash Join (cost=265.62..365.85 rows=202 width=27) (actual time=3.798..7.919 rows=4,857 loops=1)

  • Hash Cond: (turmaagrupada.turmaorigem = t_3.codigo)
86. 0.768 0.768 ↑ 1.0 5,106 1

Seq Scan on turmaagrupada (cost=0.00..79.06 rows=5,106 width=8) (actual time=0.011..0.768 rows=5,106 loops=1)

87. 0.222 3.769 ↓ 2.6 607 1

Hash (cost=262.72..262.72 rows=232 width=27) (actual time=3.766..3.769 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
88. 0.657 3.547 ↓ 2.6 607 1

Hash Join (cost=202.25..262.72 rows=232 width=27) (actual time=2.547..3.547 rows=607 loops=1)

  • Hash Cond: (horarioturma_2.turma = t_3.codigo)
89. 0.374 0.374 ↑ 1.0 2,967 1

Seq Scan on horarioturma horarioturma_2 (cost=0.00..52.67 rows=2,967 width=13) (actual time=0.007..0.374 rows=2,967 loops=1)

90. 0.189 2.516 ↓ 1.4 630 1

Hash (cost=196.53..196.53 rows=458 width=14) (actual time=2.515..2.516 rows=630 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
91. 2.327 2.327 ↓ 1.4 630 1

Seq Scan on turma t_3 (cost=0.00..196.53 rows=458 width=14) (actual time=0.023..2.327 rows=630 loops=1)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,223
92. 29.142 29.142 ↑ 2.9 13 4,857

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_2 (cost=0.42..1.76 rows=38 width=8) (actual time=0.003..0.006 rows=13 loops=4,857)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
93. 675.400 675.400 ↓ 0.0 0 61,400

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_2 (cost=0.42..0.56 rows=1 width=16) (actual time=0.010..0.011 rows=0 loops=61,400)

  • Index Cond: (horarioturmadia = horarioturmadia_2.codigo)
  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 4
94. 0.000 21.294 ↓ 0.0 0 7

Subquery Scan on *SELECT* 3_1 (cost=1,186.57..1,186.76 rows=5 width=25) (actual time=3.041..3.042 rows=0 loops=7)

95. 0.007 21.294 ↓ 0.0 0 7

Unique (cost=1,186.57..1,186.71 rows=5 width=69) (actual time=3.040..3.042 rows=0 loops=7)

96. 0.032 21.287 ↓ 0.0 0 7

Sort (cost=1,186.57..1,186.58 rows=5 width=69) (actual time=3.040..3.041 rows=0 loops=7)

  • Sort Key: horarioturma_3.codigo, turmaagrupada_1.turma, t_4.subturma, t_4.tiposubturma, t_4.turmaagrupada, disciplinaequivalente.equivalente, horarioturma_3.anovigente, horarioturma_3.semestrevigente, horarioturmadiaitem_3.disciplina, horarioturma_3.turma
  • Sort Method: quicksort Memory: 25kB
97. 0.001 21.255 ↓ 0.0 0 1

Nested Loop (cost=266.62..1,186.51 rows=5 width=69) (actual time=21.248..21.255 rows=0 loops=1)

  • Join Filter: (t_4.codigo = turmaagrupada_1.turmaorigem)
98. 1.947 21.254 ↓ 0.0 0 1

Hash Join (cost=266.34..1,183.28 rows=6 width=37) (actual time=21.247..21.254 rows=0 loops=1)

  • Hash Cond: (horarioturmadia_3.horarioturma = horarioturma_3.codigo)
  • Join Filter: ((t_4.semestral AND ((horarioturma_3.anovigente)::text = '2020'::text) AND ((horarioturma_3.semestrevigente)::text = '2'::text)) OR (t_4.anual AND ((horarioturma_3.anovigente)::text = '2020'::text)) OR ((NOT t_4.semestral) AND (NOT t_4.anual) AND (horarioturmadiaitem_3.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 4,020
99. 1.949 15.715 ↓ 7.8 4,508 1

Nested Loop (cost=0.71..914.36 rows=578 width=20) (actual time=0.064..15.715 rows=4,508 loops=1)

100. 1.177 4.750 ↓ 7.8 4,508 1

Nested Loop (cost=0.42..554.13 rows=578 width=20) (actual time=0.048..4.750 rows=4,508 loops=1)

101. 0.017 0.017 ↑ 1.0 28 1

Seq Scan on disciplinaequivalente (cost=0.00..1.28 rows=28 width=8) (actual time=0.009..0.017 rows=28 loops=1)

102. 3.556 3.556 ↓ 9.5 161 28

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_3 (cost=0.42..19.57 rows=17 width=16) (actual time=0.006..0.127 rows=161 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente.disciplina) AND (professor = 9,959))
103. 9.016 9.016 ↑ 1.0 1 4,508

Index Scan using horarioturmadia_pkey on horarioturmadia horarioturmadia_3 (cost=0.29..0.62 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=4,508)

  • Index Cond: (codigo = horarioturmadiaitem_3.horarioturmadia)
104. 0.201 3.592 ↓ 2.6 607 1

Hash (cost=262.72..262.72 rows=232 width=27) (actual time=3.590..3.592 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
105. 0.573 3.391 ↓ 2.6 607 1

Hash Join (cost=202.25..262.72 rows=232 width=27) (actual time=2.498..3.391 rows=607 loops=1)

  • Hash Cond: (horarioturma_3.turma = t_4.codigo)
106. 0.356 0.356 ↑ 1.0 2,967 1

Seq Scan on horarioturma horarioturma_3 (cost=0.00..52.67 rows=2,967 width=13) (actual time=0.011..0.356 rows=2,967 loops=1)

107. 0.165 2.462 ↓ 1.4 630 1

Hash (cost=196.53..196.53 rows=458 width=14) (actual time=2.461..2.462 rows=630 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
108. 2.297 2.297 ↓ 1.4 630 1

Seq Scan on turma t_4 (cost=0.00..196.53 rows=458 width=14) (actual time=0.022..2.297 rows=630 loops=1)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,223
109. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_1 (cost=0.28..0.44 rows=8 width=8) (never executed)

  • Index Cond: (turmaorigem = horarioturma_3.turma)
110. 0.007 78.001 ↓ 0.0 0 7

Subquery Scan on *SELECT* 4_1 (cost=1,126.27..1,126.42 rows=4 width=25) (actual time=11.142..11.143 rows=0 loops=7)

111. 0.007 77.994 ↓ 0.0 0 7

Unique (cost=1,126.27..1,126.38 rows=4 width=69) (actual time=11.141..11.142 rows=0 loops=7)

112. 0.027 77.987 ↓ 0.0 0 7

Sort (cost=1,126.27..1,126.28 rows=4 width=69) (actual time=11.140..11.141 rows=0 loops=7)

  • Sort Key: horarioturma_4.codigo, turmaagrupada_2.turma, t_5.subturma, t_5.tiposubturma, t_5.turmaagrupada, disciplinaequivalente_1.disciplina, horarioturma_4.anovigente, horarioturma_4.semestrevigente, horarioturmadiaitem_4.disciplina, horarioturma_4.turma
  • Sort Method: quicksort Memory: 25kB
113. 0.001 77.960 ↓ 0.0 0 1

Nested Loop (cost=266.62..1,126.23 rows=4 width=69) (actual time=77.954..77.960 rows=0 loops=1)

  • Join Filter: (t_5.codigo = turmaagrupada_2.turmaorigem)
114. 0.789 77.959 ↓ 0.0 0 1

Hash Join (cost=266.34..1,123.54 rows=5 width=37) (actual time=77.953..77.959 rows=0 loops=1)

  • Hash Cond: (horarioturmadia_4.horarioturma = horarioturma_4.codigo)
  • Join Filter: ((t_5.semestral AND ((horarioturma_4.anovigente)::text = '2020'::text) AND ((horarioturma_4.semestrevigente)::text = '2'::text)) OR (t_5.anual AND ((horarioturma_4.anovigente)::text = '2020'::text)) OR ((NOT t_5.semestral) AND (NOT t_5.anual) AND (horarioturmadiaitem_4.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 2,052
115. 2.514 73.269 ↓ 7.9 3,839 1

Nested Loop (cost=0.71..855.15 rows=483 width=20) (actual time=0.064..73.269 rows=3,839 loops=1)

116. 0.682 66.916 ↓ 7.9 3,839 1

Nested Loop (cost=0.42..554.13 rows=483 width=20) (actual time=0.052..66.916 rows=3,839 loops=1)

117. 0.014 0.014 ↑ 1.0 28 1

Seq Scan on disciplinaequivalente disciplinaequivalente_1 (cost=0.00..1.28 rows=28 width=8) (actual time=0.008..0.014 rows=28 loops=1)

118. 66.220 66.220 ↓ 8.1 137 28

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_4 (cost=0.42..19.57 rows=17 width=16) (actual time=0.005..2.365 rows=137 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente_1.equivalente) AND (professor = 9,959))
119. 3.839 3.839 ↑ 1.0 1 3,839

Index Scan using horarioturmadia_pkey on horarioturmadia horarioturmadia_4 (cost=0.29..0.62 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=3,839)

  • Index Cond: (codigo = horarioturmadiaitem_4.horarioturmadia)
120. 0.183 3.901 ↓ 2.6 607 1

Hash (cost=262.72..262.72 rows=232 width=27) (actual time=3.898..3.901 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
121. 0.576 3.718 ↓ 2.6 607 1

Hash Join (cost=202.25..262.72 rows=232 width=27) (actual time=2.800..3.718 rows=607 loops=1)

  • Hash Cond: (horarioturma_4.turma = t_5.codigo)
122. 0.375 0.375 ↑ 1.0 2,967 1

Seq Scan on horarioturma horarioturma_4 (cost=0.00..52.67 rows=2,967 width=13) (actual time=0.009..0.375 rows=2,967 loops=1)

123. 0.184 2.767 ↓ 1.4 630 1

Hash (cost=196.53..196.53 rows=458 width=14) (actual time=2.766..2.767 rows=630 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
124. 2.583 2.583 ↓ 1.4 630 1

Seq Scan on turma t_5 (cost=0.00..196.53 rows=458 width=14) (actual time=0.020..2.583 rows=630 loops=1)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,223
125. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_2 (cost=0.28..0.44 rows=8 width=8) (never executed)

  • Index Cond: (turmaorigem = horarioturma_4.turma)
126. 0.007 2.471 ↓ 0.0 0 7

Subquery Scan on *SELECT* 5 (cost=576.12..576.25 rows=4 width=25) (actual time=0.352..0.353 rows=0 loops=7)

127. 0.000 2.464 ↓ 0.0 0 7

Unique (cost=576.12..576.21 rows=4 width=69) (actual time=0.352..0.352 rows=0 loops=7)

128. 0.028 2.464 ↓ 0.0 0 7

Sort (cost=576.12..576.13 rows=4 width=69) (actual time=0.351..0.352 rows=0 loops=7)

  • Sort Key: horarioturma_5.codigo, t_6.codigo, t_6.subturma, t_6.tiposubturma, t_6.turmaagrupada, horarioturmadiaitem_5.disciplina, horarioturma_5.anovigente, horarioturma_5.semestrevigente
  • Sort Method: quicksort Memory: 25kB
129. 0.001 2.436 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=69) (actual time=2.433..2.436 rows=0 loops=1)

  • Join Filter: ((t_6.semestral AND ((horarioturma_5.anovigente)::text = '2020'::text) AND ((horarioturma_5.semestrevigente)::text = '2'::text)) OR (t_6.anual AND ((horarioturma_5.anovigente)::text = '2020'::text)) OR ((NOT t_6.semestral) AND (NOT t_6.anual) AND (horarioturmadiaitem_5.data >= (CURRENT_DATE - '1 year'::interval))))
130. 0.002 2.435 ↓ 0.0 0 1

Nested Loop (cost=0.70..277.17 rows=509 width=31) (actual time=2.433..2.435 rows=0 loops=1)

131. 0.001 2.433 ↓ 0.0 0 1

Nested Loop (cost=0.28..245.06 rows=15 width=27) (actual time=2.432..2.433 rows=0 loops=1)

132. 2.432 2.432 ↓ 0.0 0 1

Seq Scan on turma t_6 (cost=0.00..196.53 rows=29 width=14) (actual time=2.432..2.432 rows=0 loops=1)

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
133. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_5 (cost=0.28..1.65 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_6.codigo)
134. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_5 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_5.codigo)
135. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_5 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_5.codigo)
  • Filter: (professor = 9,959)
136. 0.007 2.177 ↓ 0.0 0 7

Subquery Scan on *SELECT* 6 (cost=579.06..579.10 rows=1 width=25) (actual time=0.311..0.311 rows=0 loops=7)

137. 0.000 2.170 ↓ 0.0 0 7

Unique (cost=579.06..579.09 rows=1 width=69) (actual time=0.310..0.310 rows=0 loops=7)

138. 0.030 2.170 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.309..0.310 rows=0 loops=7)

  • Sort Key: horarioturma_6.codigo, t_7.codigo, t_7.subturma, t_7.tiposubturma, t_7.turmaagrupada, disciplinaequivalente_2.equivalente, horarioturma_6.anovigente, horarioturma_6.semestrevigente, horarioturmadiaitem_6.disciplina
  • Sort Method: quicksort Memory: 25kB
139. 0.001 2.140 ↓ 0.0 0 1

Nested Loop (cost=1.12..579.05 rows=1 width=69) (actual time=2.136..2.140 rows=0 loops=1)

  • Join Filter: (horarioturmadiaitem_6.disciplina = disciplinaequivalente_2.disciplina)
140. 0.011 0.011 ↑ 1.0 28 1

Seq Scan on disciplinaequivalente disciplinaequivalente_2 (cost=0.00..1.28 rows=28 width=8) (actual time=0.008..0.011 rows=28 loops=1)

141. 0.010 2.128 ↓ 0.0 0 28

Materialize (cost=1.12..576.10 rows=4 width=33) (actual time=0.076..0.076 rows=0 loops=28)

142. 0.002 2.118 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.115..2.118 rows=0 loops=1)

  • Join Filter: ((t_7.semestral AND ((horarioturma_6.anovigente)::text = '2020'::text) AND ((horarioturma_6.semestrevigente)::text = '2'::text)) OR (t_7.anual AND ((horarioturma_6.anovigente)::text = '2020'::text)) OR ((NOT t_7.semestral) AND (NOT t_7.anual) AND (horarioturmadiaitem_6.data >= (CURRENT_DATE - '1 year'::interval))))
143. 0.001 2.116 ↓ 0.0 0 1

Nested Loop (cost=0.70..277.17 rows=509 width=31) (actual time=2.114..2.116 rows=0 loops=1)

144. 0.002 2.115 ↓ 0.0 0 1

Nested Loop (cost=0.28..245.06 rows=15 width=27) (actual time=2.114..2.115 rows=0 loops=1)

145. 2.113 2.113 ↓ 0.0 0 1

Seq Scan on turma t_7 (cost=0.00..196.53 rows=29 width=14) (actual time=2.113..2.113 rows=0 loops=1)

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
146. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_6 (cost=0.28..1.65 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_7.codigo)
147. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_6 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_6.codigo)
148. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_6 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_6.codigo)
  • Filter: (professor = 9,959)
149. 0.007 2.394 ↓ 0.0 0 7

Subquery Scan on *SELECT* 7 (cost=579.06..579.10 rows=1 width=25) (actual time=0.341..0.342 rows=0 loops=7)

150. 0.000 2.387 ↓ 0.0 0 7

Unique (cost=579.06..579.09 rows=1 width=69) (actual time=0.341..0.341 rows=0 loops=7)

151. 0.032 2.387 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.340..0.341 rows=0 loops=7)

  • Sort Key: horarioturma_7.codigo, t_8.codigo, t_8.subturma, t_8.tiposubturma, t_8.turmaagrupada, disciplinaequivalente_3.disciplina, horarioturma_7.anovigente, horarioturma_7.semestrevigente, horarioturmadiaitem_7.disciplina
  • Sort Method: quicksort Memory: 25kB
152. 0.019 2.355 ↓ 0.0 0 1

Nested Loop (cost=1.12..579.05 rows=1 width=69) (actual time=2.351..2.355 rows=0 loops=1)

  • Join Filter: (horarioturmadiaitem_7.disciplina = disciplinaequivalente_3.equivalente)
153. 0.012 0.012 ↑ 1.0 28 1

Seq Scan on disciplinaequivalente disciplinaequivalente_3 (cost=0.00..1.28 rows=28 width=8) (actual time=0.007..0.012 rows=28 loops=1)

154. 0.000 2.324 ↓ 0.0 0 28

Materialize (cost=1.12..576.10 rows=4 width=33) (actual time=0.083..0.083 rows=0 loops=28)

155. 0.001 2.327 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.325..2.327 rows=0 loops=1)

  • Join Filter: ((t_8.semestral AND ((horarioturma_7.anovigente)::text = '2020'::text) AND ((horarioturma_7.semestrevigente)::text = '2'::text)) OR (t_8.anual AND ((horarioturma_7.anovigente)::text = '2020'::text)) OR ((NOT t_8.semestral) AND (NOT t_8.anual) AND (horarioturmadiaitem_7.data >= (CURRENT_DATE - '1 year'::interval))))
156. 0.002 2.326 ↓ 0.0 0 1

Nested Loop (cost=0.70..277.17 rows=509 width=31) (actual time=2.324..2.326 rows=0 loops=1)

157. 0.002 2.324 ↓ 0.0 0 1

Nested Loop (cost=0.28..245.06 rows=15 width=27) (actual time=2.323..2.324 rows=0 loops=1)

158. 2.322 2.322 ↓ 0.0 0 1

Seq Scan on turma t_8 (cost=0.00..196.53 rows=29 width=14) (actual time=2.322..2.322 rows=0 loops=1)

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
159. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_7 (cost=0.28..1.65 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_8.codigo)
160. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_7 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_7.codigo)
161. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_7 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_7.codigo)
  • Filter: (professor = 9,959)
162. 10.605 10.605 ↓ 35.0 35 105

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.42..2.51 rows=1 width=33) (actual time=0.011..0.101 rows=35 loops=105)

  • Index Cond: ((turma = "*SELECT* 1_1".turma) AND (disciplina = "*SELECT* 1_1".disciplina))
  • Filter: ((turmapratica IS NULL) AND (turmateorica IS NULL) AND (turmapratica IS NULL) AND (turmateorica IS NULL) AND (("*SELECT* 1_1".ano)::text = (ano)::text) AND (("*SELECT* 1_1".semestre)::text = (semestre)::text))
  • Rows Removed by Filter: 29
163. 7.308 7.308 ↑ 1.0 1 3,654

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_1 (cost=0.29..0.31 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=3,654)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
164. 76.734 76.734 ↑ 1.0 1 3,654

Index Scan using matricula_pkey on matricula matricula_1 (cost=0.29..0.32 rows=1 width=20) (actual time=0.021..0.021 rows=1 loops=3,654)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
165. 14.616 14.616 ↑ 1.0 1 3,654

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_1 (cost=0.42..0.51 rows=1 width=49) (actual time=0.004..0.004 rows=1 loops=3,654)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_1.codigo)
  • Filter: (((((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((transferenciamatrizcurricularmatricula IS NULL) OR (transferenciamatrizcurricularmatricula IS NOT NULL))) OR (historicocursandoporcorrespondenciaapostransferencia AND (transferenciamatrizcurricularmatricula IS NOT NULL) AND ((NOT historicoporequivalencia) OR (historicoporequivalencia IS NULL))) OR historicoequivalente OR historicodisciplinafazpartecomposicao) AND ((matriculaperiodoturmadisciplina_1.matricula)::text = (matricula)::text))
166.          

SubPlan (for Nested Loop)

167. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..21.49 rows=1 width=4) (never executed)

168. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_4 (cost=0.42..21.49 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = (historico_1.matricula)::text)
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula_1.gradecurricularatual) AND ((anohistorico)::text = (historico_1.anohistorico)::text) AND ((semestrehistorico)::text = (historico_1.semestrehistorico)::text) AND (disciplina = historico_1.disciplina) AND (transferenciamatrizcurricularmatricula = historico_1.transferenciamatrizcurricularmatricula))
169. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..20.56 rows=1 width=4) (never executed)

170. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_5 (cost=0.42..20.56 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_1.disciplina) AND (matrizcurricular = matricula_1.gradecurricularatual))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((matricula)::text = (historico_1.matricula)::text) AND ((anohistorico)::text = (historico_1.anohistorico)::text) AND ((semestrehistorico)::text = (historico_1.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico_1.transferenciamatrizcurricularmatricula))
171. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.89..35.84 rows=1 width=0) (never executed)

172. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_1 (cost=0.42..21.23 rows=1 width=25) (never executed)

  • Index Cond: ((matricula)::text = (historico_1.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_1.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_1.numeroagrupamentoequivalenciadisciplina))
173. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_6 (cost=13.47..14.59 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_1.matricula)::text) AND (disciplina = hist_1.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_1.gradecurricularatual) AND ((hist_1.anohistorico)::text = (anohistorico)::text) AND ((hist_1.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_1.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
174. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=13.47..13.47 rows=1 width=0) (never executed)

175. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_historico_matricula_gradedisciplina (cost=0.00..1.78 rows=34 width=0) (never executed)

  • Index Cond: ((matricula)::text = (historico_1.matricula)::text)
176. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.44 rows=1,028 width=0) (never executed)

  • Index Cond: (disciplina = hist_1.disciplina)
177. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_7 (cost=0.42..2.65 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_1.disciplina) AND (matriculaperiodo = historico_1.matriculaperiodo) AND (matrizcurricular = matricula_1.gradecurricularatual))
  • Heap Fetches: 0
178. 7.308 7.308 ↑ 1.0 1 3,654

Index Scan using curso_pkey on curso curso_1 (cost=0.28..0.30 rows=1 width=6) (actual time=0.002..0.002 rows=1 loops=3,654)

  • Index Cond: (codigo = matricula_1.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
179. 7.308 7.308 ↑ 1.0 1 3,654

Index Only Scan using pessoa_pkey on pessoa professor_1 (cost=0.42..1.54 rows=1 width=4) (actual time=0.002..0.002 rows=1 loops=3,654)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
180. 0.007 158.480 ↓ 0.0 0 7

Subquery Scan on *SELECT* 3 (cost=229.27..980.92 rows=1 width=17) (actual time=22.636..22.640 rows=0 loops=7)

181. 0.007 158.473 ↓ 0.0 0 7

Nested Loop (cost=229.27..980.91 rows=1 width=155) (actual time=22.635..22.639 rows=0 loops=7)

182. 0.021 158.466 ↓ 0.0 0 7

Nested Loop (cost=228.85..979.36 rows=1 width=21) (actual time=22.635..22.638 rows=0 loops=7)

  • Join Filter: ((matriculaperiodoturmadisciplina_2.turmapratica = "*SELECT* 1_2".turma) AND (matriculaperiodoturmadisciplina_2.disciplina = "*SELECT* 1_2".disciplina) AND ((matriculaperiodoturmadisciplina_2.ano)::text = ("*SELECT* 1_2".ano)::text) AND ((matriculaperiodoturmadisciplina_2.semestre)::text = ("*SELECT* 1_2".semestre)::text))
183. 0.399 158.445 ↓ 0.0 0 7

Nested Loop (cost=1.71..67.30 rows=1 width=17) (actual time=22.634..22.635 rows=0 loops=7)

  • Join Filter: (((curso_2.periodicidade)::text = 'IN'::text) OR (((curso_2.periodicidade)::text = 'AN'::text) AND ((matriculaperiodoturmadisciplina_2.ano)::text = '2020'::text)) OR (((curso_2.periodicidade)::text = 'SE'::text) AND ((matriculaperiodoturmadisciplina_2.ano)::text = '2020'::text) AND ((matriculaperiodoturmadisciplina_2.semestre)::text = '2'::text)))
  • Rows Removed by Join Filter: 45
184. 72.478 157.416 ↓ 45.0 45 7

Nested Loop (cost=1.43..66.98 rows=1 width=21) (actual time=0.044..22.488 rows=45 loops=7)

  • Join Filter: (((matricula_2.gradecurricularatual = historico_2.matrizcurricular) AND ((historico_2.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_2.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_2.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 11))))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicocursandoporcorrespondenciaapostransferencia AND (historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 12) AND ((NOT historico_2.historicoporequivalencia) OR (historico_2.historicoporequivalencia IS NULL))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicoequivalente AND (SubPlan 13)) OR ((historico_2.matrizcurricular = matriculaperiodo_2.gradecurricular) AND (matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 14))))
  • Rows Removed by Join Filter: 6
185. 0.441 4.333 ↓ 51.0 51 7

Nested Loop (cost=1.01..5.48 rows=1 width=41) (actual time=0.030..0.619 rows=51 loops=7)

186. 0.490 2.107 ↓ 51.0 51 7

Nested Loop (cost=0.72..5.16 rows=1 width=45) (actual time=0.019..0.301 rows=51 loops=7)

187. 0.546 0.546 ↓ 51.0 51 7

Index Scan using idx_mptd_turmapratica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.42..2.64 rows=1 width=33) (actual time=0.009..0.078 rows=51 loops=7)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
188. 1.071 1.071 ↑ 1.0 1 357

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_2 (cost=0.29..2.51 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=357)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
189. 1.785 1.785 ↑ 1.0 1 357

Index Scan using matricula_pkey on matricula matricula_2 (cost=0.29..0.32 rows=1 width=20) (actual time=0.005..0.005 rows=1 loops=357)

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
190. 2.142 2.142 ↑ 1.0 1 357

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_2 (cost=0.42..2.65 rows=1 width=49) (actual time=0.005..0.006 rows=1 loops=357)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_2.codigo)
  • Filter: (((((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((transferenciamatrizcurricularmatricula IS NULL) OR (transferenciamatrizcurricularmatricula IS NOT NULL))) OR (historicocursandoporcorrespondenciaapostransferencia AND (transferenciamatrizcurricularmatricula IS NOT NULL) AND ((NOT historicoporequivalencia) OR (historicoporequivalencia IS NULL))) OR historicoequivalente OR historicodisciplinafazpartecomposicao) AND ((matriculaperiodoturmadisciplina_2.matricula)::text = (matricula)::text))
191.          

SubPlan (for Nested Loop)

192. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..21.49 rows=1 width=4) (never executed)

193. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_8 (cost=0.42..21.49 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = (historico_2.matricula)::text)
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula_2.gradecurricularatual) AND ((anohistorico)::text = (historico_2.anohistorico)::text) AND ((semestrehistorico)::text = (historico_2.semestrehistorico)::text) AND (disciplina = historico_2.disciplina) AND (transferenciamatrizcurricularmatricula = historico_2.transferenciamatrizcurricularmatricula))
194. 0.077 78.463 ↑ 1.0 1 77

Limit (cost=0.42..20.56 rows=1 width=4) (actual time=1.019..1.019 rows=1 loops=77)

195. 78.386 78.386 ↑ 1.0 1 77

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_9 (cost=0.42..20.56 rows=1 width=4) (actual time=1.018..1.018 rows=1 loops=77)

  • Index Cond: ((disciplina = historico_2.disciplina) AND (matrizcurricular = matricula_2.gradecurricularatual))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((matricula)::text = (historico_2.matricula)::text) AND ((anohistorico)::text = (historico_2.anohistorico)::text) AND ((semestrehistorico)::text = (historico_2.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico_2.transferenciamatrizcurricularmatricula))
  • Rows Removed by Filter: 15
196. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.89..35.84 rows=1 width=0) (never executed)

197. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_2 (cost=0.42..21.23 rows=1 width=25) (never executed)

  • Index Cond: ((matricula)::text = (historico_2.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_2.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_2.numeroagrupamentoequivalenciadisciplina))
198. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_10 (cost=13.47..14.59 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_2.matricula)::text) AND (disciplina = hist_2.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_2.gradecurricularatual) AND ((hist_2.anohistorico)::text = (anohistorico)::text) AND ((hist_2.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_2.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
199. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=13.47..13.47 rows=1 width=0) (never executed)

200. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_historico_matricula_gradedisciplina (cost=0.00..1.78 rows=34 width=0) (never executed)

  • Index Cond: ((matricula)::text = (historico_2.matricula)::text)
201. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.44 rows=1,028 width=0) (never executed)

  • Index Cond: (disciplina = hist_2.disciplina)
202. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_11 (cost=0.42..2.65 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_2.disciplina) AND (matriculaperiodo = historico_2.matriculaperiodo) AND (matrizcurricular = matricula_2.gradecurricularatual))
  • Heap Fetches: 0
203. 0.630 0.630 ↑ 1.0 1 315

Index Scan using curso_pkey on curso curso_2 (cost=0.28..0.30 rows=1 width=6) (actual time=0.002..0.002 rows=1 loops=315)

  • Index Cond: (codigo = matricula_2.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
204. 0.000 0.000 ↓ 0.0 0

Append (cost=227.14..911.98 rows=4 width=25) (never executed)

205. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 1_2 (cost=227.14..227.17 rows=1 width=25) (never executed)

206. 0.000 0.000 ↓ 0.0 0

Unique (cost=227.14..227.16 rows=1 width=69) (never executed)

207. 0.000 0.000 ↓ 0.0 0

Sort (cost=227.14..227.15 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_8.codigo, t_9.codigo, t_9.subturma, t_9.turmaagrupada, horarioturmadiaitem_8.disciplina, horarioturma_8.anovigente, horarioturma_8.semestrevigente
208. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=69) (never executed)

  • Join Filter: ((t_9.semestral AND ((horarioturma_8.anovigente)::text = '2020'::text) AND ((horarioturma_8.semestrevigente)::text = '2'::text)) OR (t_9.anual AND ((horarioturma_8.anovigente)::text = '2020'::text)) OR ((NOT t_9.semestral) AND (NOT t_9.anual) AND (horarioturmadiaitem_8.data >= (CURRENT_DATE - '1 year'::interval))))
209. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

210. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

211. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_9 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: ((NOT turmaagrupada) AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'PRATICA'::text))
212. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_8 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_9.codigo)
213. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_8 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_8.codigo)
214. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_8 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_8.codigo)
  • Filter: (professor = 9,959)
215. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 2_2 (cost=227.14..227.17 rows=1 width=25) (never executed)

216. 0.000 0.000 ↓ 0.0 0

Unique (cost=227.14..227.16 rows=1 width=69) (never executed)

217. 0.000 0.000 ↓ 0.0 0

Sort (cost=227.14..227.15 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_9.codigo, t_10.codigo, t_10.subturma, t_10.turmaagrupada, horarioturmadiaitem_9.disciplina, horarioturma_9.anovigente, horarioturma_9.semestrevigente
218. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=69) (never executed)

  • Join Filter: ((t_10.semestral AND ((horarioturma_9.anovigente)::text = '2020'::text) AND ((horarioturma_9.semestrevigente)::text = '2'::text)) OR (t_10.anual AND ((horarioturma_9.anovigente)::text = '2020'::text)) OR ((NOT t_10.semestral) AND (NOT t_10.anual) AND (horarioturmadiaitem_9.data >= (CURRENT_DATE - '1 year'::interval))))
219. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

220. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

221. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_10 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'PRATICA'::text))
222. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_9 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_10.codigo)
223. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_9 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_9.codigo)
224. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_9 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_9.codigo)
  • Filter: (professor = 9,959)
225. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 3_2 (cost=228.77..228.81 rows=1 width=25) (never executed)

226. 0.000 0.000 ↓ 0.0 0

Unique (cost=228.77..228.80 rows=1 width=69) (never executed)

227. 0.000 0.000 ↓ 0.0 0

Sort (cost=228.77..228.78 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_10.codigo, t_11.codigo, t_11.subturma, t_11.turmaagrupada, disciplinaequivalente_4.equivalente, horarioturma_10.anovigente, horarioturma_10.semestrevigente, horarioturmadiaitem_10.disciplina
228. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..228.76 rows=1 width=69) (never executed)

  • Join Filter: (horarioturmadiaitem_10.disciplina = disciplinaequivalente_4.disciplina)
229. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=33) (never executed)

  • Join Filter: ((t_11.semestral AND ((horarioturma_10.anovigente)::text = '2020'::text) AND ((horarioturma_10.semestrevigente)::text = '2'::text)) OR (t_11.anual AND ((horarioturma_10.anovigente)::text = '2020'::text)) OR ((NOT t_11.semestral) AND (NOT t_11.anual) AND (horarioturmadiaitem_10.data >= (CURRENT_DATE - '1 year'::interval))))
230. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

231. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

232. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_11 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'PRATICA'::text))
233. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_10 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_11.codigo)
234. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_10 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_10.codigo)
235. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_10 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_10.codigo)
  • Filter: (professor = 9,959)
236. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_4 (cost=0.00..1.28 rows=28 width=8) (never executed)

237. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 4_2 (cost=228.77..228.81 rows=1 width=25) (never executed)

238. 0.000 0.000 ↓ 0.0 0

Unique (cost=228.77..228.80 rows=1 width=69) (never executed)

239. 0.000 0.000 ↓ 0.0 0

Sort (cost=228.77..228.78 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_11.codigo, t_12.codigo, t_12.subturma, t_12.turmaagrupada, disciplinaequivalente_5.disciplina, horarioturma_11.anovigente, horarioturma_11.semestrevigente, horarioturmadiaitem_11.disciplina
240. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..228.76 rows=1 width=69) (never executed)

  • Join Filter: (horarioturmadiaitem_11.disciplina = disciplinaequivalente_5.equivalente)
241. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=33) (never executed)

  • Join Filter: ((t_12.semestral AND ((horarioturma_11.anovigente)::text = '2020'::text) AND ((horarioturma_11.semestrevigente)::text = '2'::text)) OR (t_12.anual AND ((horarioturma_11.anovigente)::text = '2020'::text)) OR ((NOT t_12.semestral) AND (NOT t_12.anual) AND (horarioturmadiaitem_11.data >= (CURRENT_DATE - '1 year'::interval))))
242. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

243. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

244. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_12 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'PRATICA'::text))
245. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_11 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_12.codigo)
246. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_11 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_11.codigo)
247. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_11 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_11.codigo)
  • Filter: (professor = 9,959)
248. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_5 (cost=0.00..1.28 rows=28 width=8) (never executed)

249. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa professor_2 (cost=0.42..1.54 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
250. 0.007 0.098 ↓ 0.0 0 7

Subquery Scan on *SELECT* 4 (cost=229.27..980.92 rows=1 width=17) (actual time=0.011..0.014 rows=0 loops=7)

251. 0.007 0.091 ↓ 0.0 0 7

Nested Loop (cost=229.27..980.91 rows=1 width=155) (actual time=0.010..0.013 rows=0 loops=7)

252. 0.014 0.084 ↓ 0.0 0 7

Nested Loop (cost=228.85..979.36 rows=1 width=21) (actual time=0.009..0.012 rows=0 loops=7)

  • Join Filter: ((matriculaperiodoturmadisciplina_3.turmateorica = "*SELECT* 1_3".turma) AND (matriculaperiodoturmadisciplina_3.disciplina = "*SELECT* 1_3".disciplina) AND ((matriculaperiodoturmadisciplina_3.ano)::text = ("*SELECT* 1_3".ano)::text) AND ((matriculaperiodoturmadisciplina_3.semestre)::text = ("*SELECT* 1_3".semestre)::text))
253. 0.007 0.070 ↓ 0.0 0 7

Nested Loop (cost=1.71..67.30 rows=1 width=17) (actual time=0.009..0.010 rows=0 loops=7)

  • Join Filter: (((curso_3.periodicidade)::text = 'IN'::text) OR (((curso_3.periodicidade)::text = 'AN'::text) AND ((matriculaperiodoturmadisciplina_3.ano)::text = '2020'::text)) OR (((curso_3.periodicidade)::text = 'SE'::text) AND ((matriculaperiodoturmadisciplina_3.ano)::text = '2020'::text) AND ((matriculaperiodoturmadisciplina_3.semestre)::text = '2'::text)))
254. 0.007 0.063 ↓ 0.0 0 7

Nested Loop (cost=1.43..66.98 rows=1 width=21) (actual time=0.008..0.009 rows=0 loops=7)

  • Join Filter: (((matricula_3.gradecurricularatual = historico_3.matrizcurricular) AND ((historico_3.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_3.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_3.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 15))))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicocursandoporcorrespondenciaapostransferencia AND (historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 16) AND ((NOT historico_3.historicoporequivalencia) OR (historico_3.historicoporequivalencia IS NULL))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicoequivalente AND (SubPlan 17)) OR ((historico_3.matrizcurricular = matriculaperiodo_3.gradecurricular) AND (matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 18))))
255. 0.000 0.056 ↓ 0.0 0 7

Nested Loop (cost=1.01..5.48 rows=1 width=41) (actual time=0.008..0.008 rows=0 loops=7)

256. 0.007 0.056 ↓ 0.0 0 7

Nested Loop (cost=0.72..5.16 rows=1 width=45) (actual time=0.007..0.008 rows=0 loops=7)

257. 0.049 0.049 ↓ 0.0 0 7

Index Scan using idx_mptd_turmateorica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.42..2.64 rows=1 width=33) (actual time=0.007..0.007 rows=0 loops=7)

  • Index Cond: ((turmateorica IS NOT NULL) AND (turmateorica IS NOT NULL))
258. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_3 (cost=0.29..2.51 rows=1 width=20) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.matriculaperiodo)
259. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula matricula_3 (cost=0.29..0.32 rows=1 width=20) (never executed)

  • Index Cond: ((matricula)::text = (matriculaperiodo_3.matricula)::text)
260. 0.000 0.000 ↓ 0.0 0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_3 (cost=0.42..2.65 rows=1 width=49) (never executed)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_3.codigo)
  • Filter: (((((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((transferenciamatrizcurricularmatricula IS NULL) OR (transferenciamatrizcurricularmatricula IS NOT NULL))) OR (historicocursandoporcorrespondenciaapostransferencia AND (transferenciamatrizcurricularmatricula IS NOT NULL) AND ((NOT historicoporequivalencia) OR (historicoporequivalencia IS NULL))) OR historicoequivalente OR historicodisciplinafazpartecomposicao) AND ((matriculaperiodoturmadisciplina_3.matricula)::text = (matricula)::text))
261.          

SubPlan (for Nested Loop)

262. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..21.49 rows=1 width=4) (never executed)

263. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_12 (cost=0.42..21.49 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = (historico_3.matricula)::text)
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula_3.gradecurricularatual) AND ((anohistorico)::text = (historico_3.anohistorico)::text) AND ((semestrehistorico)::text = (historico_3.semestrehistorico)::text) AND (disciplina = historico_3.disciplina) AND (transferenciamatrizcurricularmatricula = historico_3.transferenciamatrizcurricularmatricula))
264. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.42..20.56 rows=1 width=4) (never executed)

265. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_13 (cost=0.42..20.56 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_3.disciplina) AND (matrizcurricular = matricula_3.gradecurricularatual))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((matricula)::text = (historico_3.matricula)::text) AND ((anohistorico)::text = (historico_3.anohistorico)::text) AND ((semestrehistorico)::text = (historico_3.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico_3.transferenciamatrizcurricularmatricula))
266. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.89..35.84 rows=1 width=0) (never executed)

267. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_3 (cost=0.42..21.23 rows=1 width=25) (never executed)

  • Index Cond: ((matricula)::text = (historico_3.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_3.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_3.numeroagrupamentoequivalenciadisciplina))
268. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_14 (cost=13.47..14.59 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_3.matricula)::text) AND (disciplina = hist_3.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_3.gradecurricularatual) AND ((hist_3.anohistorico)::text = (anohistorico)::text) AND ((hist_3.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_3.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
269. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=13.47..13.47 rows=1 width=0) (never executed)

270. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_historico_matricula_gradedisciplina (cost=0.00..1.78 rows=34 width=0) (never executed)

  • Index Cond: ((matricula)::text = (historico_3.matricula)::text)
271. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.44 rows=1,028 width=0) (never executed)

  • Index Cond: (disciplina = hist_3.disciplina)
272. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_15 (cost=0.42..2.65 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_3.disciplina) AND (matriculaperiodo = historico_3.matriculaperiodo) AND (matrizcurricular = matricula_3.gradecurricularatual))
  • Heap Fetches: 0
273. 0.000 0.000 ↓ 0.0 0

Index Scan using curso_pkey on curso curso_3 (cost=0.28..0.30 rows=1 width=6) (never executed)

  • Index Cond: (codigo = matricula_3.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
274. 0.000 0.000 ↓ 0.0 0

Append (cost=227.14..911.98 rows=4 width=25) (never executed)

275. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 1_3 (cost=227.14..227.17 rows=1 width=25) (never executed)

276. 0.000 0.000 ↓ 0.0 0

Unique (cost=227.14..227.16 rows=1 width=69) (never executed)

277. 0.000 0.000 ↓ 0.0 0

Sort (cost=227.14..227.15 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_12.codigo, t_13.codigo, t_13.subturma, t_13.turmaagrupada, horarioturmadiaitem_12.disciplina, horarioturma_12.anovigente, horarioturma_12.semestrevigente
278. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=69) (never executed)

  • Join Filter: ((t_13.semestral AND ((horarioturma_12.anovigente)::text = '2020'::text) AND ((horarioturma_12.semestrevigente)::text = '2'::text)) OR (t_13.anual AND ((horarioturma_12.anovigente)::text = '2020'::text)) OR ((NOT t_13.semestral) AND (NOT t_13.anual) AND (horarioturmadiaitem_12.data >= (CURRENT_DATE - '1 year'::interval))))
279. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

280. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

281. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_13 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: ((NOT turmaagrupada) AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
282. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_12 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_13.codigo)
283. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_12 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_12.codigo)
284. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_12 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_12.codigo)
  • Filter: (professor = 9,959)
285. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 2_3 (cost=227.14..227.17 rows=1 width=25) (never executed)

286. 0.000 0.000 ↓ 0.0 0

Unique (cost=227.14..227.16 rows=1 width=69) (never executed)

287. 0.000 0.000 ↓ 0.0 0

Sort (cost=227.14..227.15 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_13.codigo, t_14.codigo, t_14.subturma, t_14.turmaagrupada, horarioturmadiaitem_13.disciplina, horarioturma_13.anovigente, horarioturma_13.semestrevigente
288. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=69) (never executed)

  • Join Filter: ((t_14.semestral AND ((horarioturma_13.anovigente)::text = '2020'::text) AND ((horarioturma_13.semestrevigente)::text = '2'::text)) OR (t_14.anual AND ((horarioturma_13.anovigente)::text = '2020'::text)) OR ((NOT t_14.semestral) AND (NOT t_14.anual) AND (horarioturmadiaitem_13.data >= (CURRENT_DATE - '1 year'::interval))))
289. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

290. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

291. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_14 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
292. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_13 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_14.codigo)
293. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_13 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_13.codigo)
294. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_13 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_13.codigo)
  • Filter: (professor = 9,959)
295. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 3_3 (cost=228.77..228.81 rows=1 width=25) (never executed)

296. 0.000 0.000 ↓ 0.0 0

Unique (cost=228.77..228.80 rows=1 width=69) (never executed)

297. 0.000 0.000 ↓ 0.0 0

Sort (cost=228.77..228.78 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_14.codigo, t_15.codigo, t_15.subturma, t_15.turmaagrupada, disciplinaequivalente_6.equivalente, horarioturma_14.anovigente, horarioturma_14.semestrevigente, horarioturmadiaitem_14.disciplina
298. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..228.76 rows=1 width=69) (never executed)

  • Join Filter: (horarioturmadiaitem_14.disciplina = disciplinaequivalente_6.disciplina)
299. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=33) (never executed)

  • Join Filter: ((t_15.semestral AND ((horarioturma_14.anovigente)::text = '2020'::text) AND ((horarioturma_14.semestrevigente)::text = '2'::text)) OR (t_15.anual AND ((horarioturma_14.anovigente)::text = '2020'::text)) OR ((NOT t_15.semestral) AND (NOT t_15.anual) AND (horarioturmadiaitem_14.data >= (CURRENT_DATE - '1 year'::interval))))
300. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

301. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

302. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_15 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
303. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_14 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_15.codigo)
304. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_14 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_14.codigo)
305. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_14 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_14.codigo)
  • Filter: (professor = 9,959)
306. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_6 (cost=0.00..1.28 rows=28 width=8) (never executed)

307. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 4_3 (cost=228.77..228.81 rows=1 width=25) (never executed)

308. 0.000 0.000 ↓ 0.0 0

Unique (cost=228.77..228.80 rows=1 width=69) (never executed)

309. 0.000 0.000 ↓ 0.0 0

Sort (cost=228.77..228.78 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_15.codigo, t_16.codigo, t_16.subturma, t_16.turmaagrupada, disciplinaequivalente_7.disciplina, horarioturma_15.anovigente, horarioturma_15.semestrevigente, horarioturmadiaitem_15.disciplina
310. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..228.76 rows=1 width=69) (never executed)

  • Join Filter: (horarioturmadiaitem_15.disciplina = disciplinaequivalente_7.equivalente)
311. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.12..227.13 rows=1 width=33) (never executed)

  • Join Filter: ((t_16.semestral AND ((horarioturma_15.anovigente)::text = '2020'::text) AND ((horarioturma_15.semestrevigente)::text = '2'::text)) OR (t_16.anual AND ((horarioturma_15.anovigente)::text = '2020'::text)) OR ((NOT t_16.semestral) AND (NOT t_16.anual) AND (horarioturmadiaitem_15.data >= (CURRENT_DATE - '1 year'::interval))))
312. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..216.56 rows=18 width=31) (never executed)

313. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.28..214.42 rows=1 width=27) (never executed)

314. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_16 (cost=0.00..211.16 rows=1 width=14) (never executed)

  • Filter: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
315. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_turma_semestre_ano_key on horarioturma horarioturma_15 (cost=0.28..3.24 rows=2 width=13) (never executed)

  • Index Cond: (turma = t_16.codigo)
316. 0.000 0.000 ↓ 0.0 0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_15 (cost=0.42..1.76 rows=38 width=8) (never executed)

  • Index Cond: (horarioturma = horarioturma_15.codigo)
317. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem horarioturmadiaitem_15 (cost=0.42..0.56 rows=1 width=16) (never executed)

  • Index Cond: (horarioturmadia = horarioturmadia_15.codigo)
  • Filter: (professor = 9,959)
318. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_7 (cost=0.00..1.28 rows=28 width=8) (never executed)

319. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa professor_3 (cost=0.42..1.54 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
320. 0.994 0.994 ↑ 7.0 2 497

Index Scan using unique_atividadediscursiva_matriculaperiodoturmadisciplina on atividadediscursivarespostaaluno (cost=0.28..1.29 rows=14 width=41) (actual time=0.001..0.002 rows=2 loops=497)

  • Index Cond: (atividadediscursiva = atividadediscursiva.codigo)
321.          

SubPlan (for GroupAggregate)

322. 0.000 0.000 ↓ 0.0 0 497

Index Scan using idx_atividadediscursivainteracao_atividadediscursivarespostaalu on atividadediscursivainteracao (cost=0.28..2.50 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=497)

  • Index Cond: (atividadediscursivarespostaaluno = atividadediscursivarespostaaluno.codigo)
  • Filter: ((NOT interacaojalida) AND ((interagidopor)::text = 'ALUNO'::text))
  • Rows Removed by Filter: 0
323. 0.000 0.000 ↓ 0.0 0

Seq Scan on atividadediscursivainteracao atividadediscursivainteracao_1 (cost=0.00..117.97 rows=271 width=4) (never executed)

  • Filter: ((NOT interacaojalida) AND ((interagidopor)::text = 'ALUNO'::text))
Planning time : 295.529 ms
Execution time : 2,688.803 ms