explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gezL

Settings
# exclusive inclusive rows x rows loops node
1. 0.011 2,600.699 ↑ 1.0 1 1

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

2. 0.009 2,600.688 ↓ 7.0 7 1

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

3. 0.033 2,600.679 ↓ 7.0 7 1

Sort (cost=20,376.69..20,376.69 rows=1 width=546) (actual time=2,600.198..2,600.679 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.610 2,600.646 ↓ 7.0 7 1

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

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

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

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

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

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

Nested Loop Left Join (cost=107.50..20,372.66 rows=1 width=494) (actual time=1,093.568..2,597.465 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. 0.988 920.377 ↓ 7.0 7 1

Nested Loop (cost=59.63..434.98 rows=1 width=508) (actual time=910.444..920.377 rows=7 loops=1)

9. 0.794 3.225 ↑ 1.0 459 1

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

10. 0.595 0.595 ↑ 1.0 459 1

Index Scan using atividadediscursiva_pkey on atividadediscursiva (cost=0.27..44.74 rows=459 width=445) (actual time=0.018..0.595 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 916.164 ↓ 0.0 0 459

Hash Join (cost=59.08..59.11 rows=1 width=47) (actual time=1.996..1.996 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.000 911.574 ↓ 0.0 0 459

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

  • Filter: (turma.codigo = horarioprofessor.turma)
14. 0.918 911.574 ↓ 0.0 0 459

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

15. 1.836 910.656 ↑ 1.0 1 459

Sort (cost=58.70..58.71 rows=1 width=69) (actual time=1.984..1.984 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 908.820 ↑ 1.0 1 459

Nested Loop (cost=1.40..58.69 rows=1 width=69) (actual time=1.977..1.980 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. 34.535 906.066 ↓ 2.2 9 459

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

19. 78.848 179.928 ↓ 2.0 137 459

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

20. 74.358 74.358 ↑ 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.003..0.162 rows=2 loops=459)

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

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

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

Index Scan using horarioturmadiaitem_uniq on horarioturmadiaitem (cost=0.42..0.56 rows=1 width=16) (actual time=0.011..0.011 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.546 1,675.618 ↓ 130.5 522 7

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

26. 0.007 22.533 ↓ 0.0 0 7

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

27. 0.000 22.526 ↓ 0.0 0 7

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

28. 0.980 22.526 ↓ 0.0 0 7

Nested Loop (cost=47.45..143.62 rows=1 width=21) (actual time=3.216..3.218 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. 0.833 19.418 ↓ 152.0 152 7

Nested Loop (cost=47.17..143.29 rows=1 width=25) (actual time=0.117..2.774 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.099 13.125 ↓ 156.0 156 7

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

31. 0.735 6.566 ↓ 156.0 156 7

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

32. 0.378 2.555 ↓ 156.0 156 7

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

33. 0.084 0.357 ↑ 1.0 13 7

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

34. 0.050 0.273 ↑ 1.0 13 7

Sort (cost=45.74..45.77 rows=13 width=92) (actual time=0.036..0.039 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.020 0.223 ↑ 1.0 13 1

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

36. 0.011 0.177 ↑ 1.0 13 1

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

37. 0.127 0.127 ↑ 1.0 13 1

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

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

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

  • Index Cond: (codigo = programacaotutoriaonlineprofessor.programacaotutoriaonline)
39. 0.026 0.026 ↑ 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.002..0.002 rows=1 loops=13)

  • Index Cond: (codigo = programacaotutoriaonline.turma)
40. 1.820 1.820 ↓ 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.020 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. 2.128 2.128 ↑ 1.0 1 1,064

Index Scan using curso_pkey on curso (cost=0.28..0.30 rows=1 width=6) (actual time=0.002..0.002 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.693 1,556.653 ↓ 522.0 522 7

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

59. 1.883 1,555.960 ↓ 522.0 522 7

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

60. 1.736 1,546.769 ↓ 522.0 522 7

Nested Loop (cost=7,157.33..17,828.98 rows=1 width=21) (actual time=25.733..220.967 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. 76.993 1,471.953 ↓ 522.0 522 7

Nested Loop (cost=7,157.06..17,828.66 rows=1 width=25) (actual time=25.724..210.279 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.103 1,376.690 ↓ 522.0 522 7

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

63. 2.709 1,291.199 ↓ 522.0 522 7

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

64. 0.917 1,277.528 ↓ 522.0 522 7

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

65. 0.070 1,263.906 ↑ 43.1 15 7

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

66. 0.035 180.390 ↑ 114.8 5 7

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

67. 0.287 180.355 ↑ 114.8 5 7

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

68. 0.225 180.068 ↑ 7.7 75 7

Sort (cost=7,155.62..7,157.06 rows=574 width=69) (actual time=25.664..25.724 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. 115.790 179.843 ↑ 7.7 75 1

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

  • Workers Planned: 2
  • Workers Launched: 2
70. 24.892 64.053 ↑ 9.6 25 3 / 3

Hash Join (cost=409.74..6,071.92 rows=239 width=69) (actual time=32.751..64.053 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.131 36.420 ↑ 1.3 2,163 3 / 3

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

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

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

73. 2.121 2.384 ↑ 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.369..2.384 rows=2,163 loops=3)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=922
74. 0.263 0.263 ↑ 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.790..0.790 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
75. 28.123 28.123 ↑ 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.013..0.013 rows=1 loops=6,490)

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

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 170kB
77. 1.462 1.462 ↑ 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.026..1.462 rows=2,967 loops=3)

78. 0.697 2.741 ↑ 1.0 3,885 2 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 207kB
79. 2.044 2.044 ↑ 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.094..3.066 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.063 898.814 ↑ 5.7 10 7

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

81. 1.764 898.751 ↑ 5.7 10 7

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

82. 1.392 896.987 ↓ 8.4 480 7

Sort (cost=4,916.66..4,916.80 rows=57 width=69) (actual time=128.096..128.141 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. 80.625 895.595 ↓ 8.4 480 1

Nested Loop (cost=266.46..4,915.00 rows=57 width=69) (actual time=303.699..895.595 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. 90.892 200.970 ↓ 8.8 61,400 1

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

85. 3.337 8.081 ↓ 24.0 4,857 1

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

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

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

87. 0.217 3.955 ↓ 2.6 607 1

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

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

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

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

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

90. 0.194 2.715 ↓ 1.4 630 1

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

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

Seq Scan on turma t_3 (cost=0.00..196.53 rows=458 width=14) (actual time=0.022..2.521 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. 101.997 101.997 ↑ 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.021 rows=13 loops=4,857)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
93. 614.000 614.000 ↓ 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.010 rows=0 loops=61,400)

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

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

95. 0.000 95.333 ↓ 0.0 0 7

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

96. 0.027 95.333 ↓ 0.0 0 7

Sort (cost=1,186.57..1,186.58 rows=5 width=69) (actual time=13.618..13.619 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.002 95.306 ↓ 0.0 0 1

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

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

Hash Join (cost=266.34..1,183.28 rows=6 width=37) (actual time=95.297..95.304 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. 3.259 17.210 ↓ 7.8 4,508 1

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

100. 1.306 4.935 ↓ 7.8 4,508 1

Nested Loop (cost=0.42..554.13 rows=578 width=20) (actual time=0.048..4.935 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.612 3.612 ↓ 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.007..0.129 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.227 75.889 ↓ 2.6 607 1

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

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

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

  • Hash Cond: (horarioturma_3.turma = t_4.codigo)
106. 72.538 72.538 ↑ 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..72.538 rows=2,967 loops=1)

107. 0.172 2.450 ↓ 1.4 630 1

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

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

Seq Scan on turma t_4 (cost=0.00..196.53 rows=458 width=14) (actual time=0.022..2.278 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 82.369 ↓ 0.0 0 7

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

111. 0.007 82.362 ↓ 0.0 0 7

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

112. 0.025 82.355 ↓ 0.0 0 7

Sort (cost=1,126.27..1,126.28 rows=4 width=69) (actual time=11.764..11.765 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.002 82.330 ↓ 0.0 0 1

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

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

Hash Join (cost=266.34..1,123.54 rows=5 width=37) (actual time=82.322..82.328 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. 0.513 77.386 ↓ 7.9 3,839 1

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

116. 1.005 3.932 ↓ 7.9 3,839 1

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

117. 0.015 0.015 ↑ 1.0 28 1

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

118. 2.912 2.912 ↓ 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.006..0.104 rows=137 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente_1.equivalente) AND (professor = 9,959))
119. 72.941 72.941 ↑ 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.019..0.019 rows=1 loops=3,839)

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

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

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

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

  • Hash Cond: (horarioturma_4.turma = t_5.codigo)
122. 0.351 0.351 ↑ 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.351 rows=2,967 loops=1)

123. 0.178 2.572 ↓ 1.4 630 1

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

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

Seq Scan on turma t_5 (cost=0.00..196.53 rows=458 width=14) (actual time=0.024..2.394 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.513 ↓ 0.0 0 7

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

127. 0.000 2.506 ↓ 0.0 0 7

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

128. 0.029 2.506 ↓ 0.0 0 7

Sort (cost=576.12..576.13 rows=4 width=69) (actual time=0.357..0.358 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.002 2.477 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=69) (actual time=2.474..2.477 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.001 2.475 ↓ 0.0 0 1

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

131. 0.002 2.474 ↓ 0.0 0 1

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

132. 2.472 2.472 ↓ 0.0 0 1

Seq Scan on turma t_6 (cost=0.00..196.53 rows=29 width=14) (actual time=2.472..2.472 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.163 ↓ 0.0 0 7

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

137. 0.000 2.156 ↓ 0.0 0 7

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

138. 0.031 2.156 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.307..0.308 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.015 2.125 ↓ 0.0 0 1

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

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

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

141. 0.000 2.100 ↓ 0.0 0 28

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

142. 0.002 2.102 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.099..2.102 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.002 2.100 ↓ 0.0 0 1

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

144. 0.001 2.098 ↓ 0.0 0 1

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

145. 2.097 2.097 ↓ 0.0 0 1

Seq Scan on turma t_7 (cost=0.00..196.53 rows=29 width=14) (actual time=2.097..2.097 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.247 ↓ 0.0 0 7

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

150. 0.000 2.240 ↓ 0.0 0 7

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

151. 0.025 2.240 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.319..0.320 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.000 2.215 ↓ 0.0 0 1

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

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

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

154. 0.022 2.212 ↓ 0.0 0 28

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

155. 0.002 2.190 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.187..2.190 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.188 ↓ 0.0 0 1

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

157. 0.002 2.186 ↓ 0.0 0 1

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

158. 2.184 2.184 ↓ 0.0 0 1

Seq Scan on turma t_8 (cost=0.00..196.53 rows=29 width=14) (actual time=2.184..2.184 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. 12.705 12.705 ↓ 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.012..0.121 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. 10.962 10.962 ↑ 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.003..0.003 rows=1 loops=3,654)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
164. 80.388 80.388 ↑ 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.022..0.022 rows=1 loops=3,654)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
165. 18.270 18.270 ↑ 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.005..0.005 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. 73.080 73.080 ↑ 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.020..0.020 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 95.788 ↓ 0.0 0 7

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

181. 0.007 95.781 ↓ 0.0 0 7

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

182. 0.021 95.774 ↓ 0.0 0 7

Nested Loop (cost=228.85..979.36 rows=1 width=21) (actual time=13.678..13.682 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.406 95.753 ↓ 0.0 0 7

Nested Loop (cost=1.71..67.30 rows=1 width=17) (actual time=13.677..13.679 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. 0.602 94.717 ↓ 45.0 45 7

Nested Loop (cost=1.43..66.98 rows=1 width=21) (actual time=0.050..13.531 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.602 4.655 ↓ 51.0 51 7

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

186. 0.259 2.268 ↓ 51.0 51 7

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

187. 0.581 0.581 ↓ 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.011..0.083 rows=51 loops=7)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
188. 1.428 1.428 ↑ 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.004..0.004 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.006..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 87.318 ↑ 1.0 1 77

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

195. 87.241 87.241 ↑ 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.133..1.133 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.010..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.009..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.008..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.007 0.056 ↓ 0.0 0 7

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

256. 0.000 0.049 ↓ 0.0 0 7

Nested Loop (cost=0.72..5.16 rows=1 width=45) (actual time=0.007..0.007 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.002..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 : 288.961 ms
Execution time : 2,606.712 ms