explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wNxh

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1,687.503 ↑ 1.0 1 1

Aggregate (cost=27,289.34..27,289.35 rows=1 width=32) (actual time=1,687.044..1,687.503 rows=1 loops=1)

2. 0.006 1,687.496 ↓ 7.0 7 1

Unique (cost=27,289.27..27,289.32 rows=1 width=546) (actual time=1,687.031..1,687.496 rows=7 loops=1)

3. 0.031 1,687.490 ↓ 7.0 7 1

Sort (cost=27,289.27..27,289.28 rows=1 width=546) (actual time=1,687.030..1,687.490 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.420 1,687.459 ↓ 7.0 7 1

GroupAggregate (cost=27,286.71..27,289.26 rows=1 width=546) (actual time=1,686.663..1,687.459 rows=7 loops=1)

  • Group Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
5. 0.606 1,687.039 ↓ 497.0 497 1

Sort (cost=27,286.71..27,286.72 rows=1 width=527) (actual time=1,686.555..1,687.039 rows=497 loops=1)

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

Merge Join (cost=7,329.08..27,286.70 rows=1 width=527) (actual time=1,201.726..1,686.433 rows=497 loops=1)

  • Merge Cond: (disciplina.codigo = atividadediscursiva.disciplina)
7. 0.552 0.552 ↑ 1.0 1,601 1

Index Scan using disciplina_pkey on disciplina (cost=0.28..54.13 rows=1,674 width=34) (actual time=0.040..0.552 rows=1,601 loops=1)

8. 0.690 1,685.417 ↓ 497.0 497 1

Materialize (cost=7,327.27..27,229.48 rows=1 width=501) (actual time=1,201.316..1,685.417 rows=497 loops=1)

9. 0.497 1,684.727 ↓ 497.0 497 1

Nested Loop Left Join (cost=7,327.27..27,229.48 rows=1 width=501) (actual time=1,201.307..1,684.727 rows=497 loops=1)

  • Join Filter: (atividadediscursivarespostaaluno.matriculaperiodoturmadisciplina = "*SELECT* 1".matriculaperiodoturmadisciplina)
  • Rows Removed by Join Filter: 757
10. 1.152 1,683.236 ↓ 497.0 497 1

Nested Loop Left Join (cost=7,326.99..27,228.02 rows=1 width=468) (actual time=1,201.288..1,683.236 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
11. 0.031 99.895 ↓ 7.0 7 1

Nested Loop (cost=7,279.13..7,293.20 rows=1 width=478) (actual time=99.470..99.895 rows=7 loops=1)

  • Join Filter: (atividadediscursiva.turma = turma.codigo)
12. 0.147 99.794 ↓ 7.0 7 1

Merge Join (cost=7,278.84..7,292.62 rows=1 width=453) (actual time=99.450..99.794 rows=7 loops=1)

  • Merge Cond: ((atividadediscursiva.disciplina = horarioprofessor.disciplina) AND (atividadediscursiva.turma = horarioprofessor.turma) AND ((atividadediscursiva.ano)::text = (horarioprofessor.ano)::text) AND ((atividadediscursiva.semestre)::text = (horarioprofessor.semestre)::text))
13. 0.662 1.054 ↑ 1.0 459 1

Sort (cost=55.88..57.03 rows=459 width=445) (actual time=0.980..1.054 rows=459 loops=1)

  • Sort Key: atividadediscursiva.disciplina, atividadediscursiva.turma, atividadediscursiva.ano, atividadediscursiva.semestre
  • Sort Method: quicksort Memory: 320kB
14. 0.392 0.392 ↑ 1.0 459 1

Seq Scan on atividadediscursiva (cost=0.00..35.59 rows=459 width=445) (actual time=0.017..0.392 rows=459 loops=1)

15. 0.028 98.593 ↑ 80.2 8 1

Sort (cost=7,222.96..7,224.57 rows=642 width=13) (actual time=98.376..98.593 rows=8 loops=1)

  • Sort Key: horarioprofessor.disciplina, horarioprofessor.turma, horarioprofessor.ano, horarioprofessor.semestre
  • Sort Method: quicksort Memory: 25kB
16. 0.006 98.565 ↑ 64.2 10 1

Subquery Scan on horarioprofessor (cost=7,172.16..7,193.02 rows=642 width=13) (actual time=98.196..98.565 rows=10 loops=1)

17. 0.137 98.559 ↑ 64.2 10 1

Unique (cost=7,172.16..7,186.60 rows=642 width=69) (actual time=98.194..98.559 rows=10 loops=1)

18. 0.525 98.422 ↑ 2.0 315 1

Sort (cost=7,172.16..7,173.76 rows=642 width=69) (actual time=98.193..98.422 rows=315 loops=1)

  • Sort Key: horarioturma.codigo, t.codigo, t.subturma, t.tiposubturma, t.turmaagrupada, horarioturmadiaitem.disciplina, horarioturma.anovigente, horarioturma.semestrevigente
  • Sort Method: quicksort Memory: 69kB
19. 60.351 97.897 ↑ 2.0 315 1

Gather (cost=1,415.84..7,142.22 rows=642 width=69) (actual time=76.573..97.897 rows=315 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
20. 0.997 37.546 ↑ 2.6 105 3 / 3

Hash Join (cost=415.84..6,078.02 rows=268 width=69) (actual time=30.676..37.546 rows=105 loops=3)

  • Hash Cond: (horarioturma.turma = t.codigo)
  • 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: 2,058
21. 1.020 10.184 ↑ 1.3 2,163 3 / 3

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

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
22. 1.686 7.758 ↑ 1.3 2,163 3 / 3

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

23. 1.521 1.745 ↑ 1.3 2,163 3 / 3

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

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,152
24. 0.224 0.224 ↑ 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.672..0.672 rows=6,490 loops=1)

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

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

  • Index Cond: (codigo = horarioturmadiaitem.horarioturmadia)
26. 0.726 1.406 ↑ 1.0 2,967 3 / 3

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

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

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

28. 22.964 26.365 ↓ 1.3 5,853 3 / 3

Hash (cost=196.53..196.53 rows=4,529 width=14) (actual time=26.365..26.365 rows=5,853 loops=3)

  • Buckets: 8,192 Batches: 1 Memory Usage: 326kB
29. 3.401 3.401 ↓ 1.3 5,853 3 / 3

Seq Scan on turma t (cost=0.00..196.53 rows=4,529 width=14) (actual time=0.020..3.401 rows=5,853 loops=3)

  • Filter: (semestral OR anual OR ((NOT semestral) AND (NOT anual)))
30. 0.070 0.070 ↑ 1.0 1 7

Index Scan using turma_pkey on turma (cost=0.28..0.57 rows=1 width=29) (actual time=0.010..0.010 rows=1 loops=7)

  • Index Cond: (codigo = horarioprofessor.turma)
31. 0.455 1,582.189 ↓ 130.5 522 7

Append (cost=47.87..19,934.71 rows=4 width=17) (actual time=46.010..226.027 rows=522 loops=7)

32. 0.007 220.822 ↓ 0.0 0 7

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

33. 0.000 220.815 ↓ 0.0 0 7

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

34. 0.875 220.815 ↓ 0.0 0 7

Nested Loop (cost=47.45..143.62 rows=1 width=21) (actual time=31.543..31.545 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
35. 0.924 217.812 ↓ 152.0 152 7

Nested Loop (cost=47.17..143.29 rows=1 width=25) (actual time=0.111..31.116 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
36. 65.751 148.092 ↓ 156.0 156 7

Nested Loop (cost=46.75..82.15 rows=1 width=33) (actual time=0.100..21.156 rows=156 loops=7)

37. 0.385 77.973 ↓ 156.0 156 7

Nested Loop (cost=46.46..81.83 rows=1 width=37) (actual time=0.091..11.139 rows=156 loops=7)

38. 0.378 2.240 ↓ 156.0 156 7

Nested Loop (cost=46.17..80.68 rows=1 width=25) (actual time=0.083..0.320 rows=156 loops=7)

39. 0.070 0.406 ↑ 1.0 13 7

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

40. 0.045 0.336 ↑ 1.0 13 7

Sort (cost=45.74..45.77 rows=13 width=92) (actual time=0.045..0.048 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
41. 0.017 0.291 ↑ 1.0 13 1

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

42. 0.010 0.235 ↑ 1.0 13 1

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

43. 0.173 0.173 ↑ 1.0 13 1

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

  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 954
44. 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)
45. 0.039 0.039 ↑ 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.003..0.003 rows=1 loops=13)

  • Index Cond: (codigo = programacaotutoriaonline.turma)
46. 1.456 1.456 ↓ 12.0 12 91

Index Scan using idx_mptd_programacaotutoriaonlineprofessor on matriculaperiodoturmadisciplina (cost=0.42..2.64 rows=1 width=25) (actual time=0.003..0.016 rows=12 loops=91)

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

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

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

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

  • Index Cond: ((matricula)::text = (matriculaperiodo.matricula)::text)
49. 68.796 68.796 ↑ 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.004..0.063 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)
50.          

SubPlan (for Nested Loop)

51. 0.000 0.000 ↓ 0.0 0

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

52. 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))
53. 0.000 0.000 ↓ 0.0 0

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

54. 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))
55. 0.000 0.000 ↓ 0.0 0

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

56. 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))
57. 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))
58. 0.000 0.000 ↓ 0.0 0

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

59. 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)
60. 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)
61. 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
62. 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))
63. 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
64. 0.602 1,340.808 ↓ 522.0 522 7

Subquery Scan on *SELECT* 2 (cost=7,157.60..17,827.69 rows=1 width=17) (actual time=14.464..191.544 rows=522 loops=7)

65. 0.595 1,340.206 ↓ 522.0 522 7

Nested Loop (cost=7,157.60..17,827.68 rows=1 width=155) (actual time=14.463..191.458 rows=522 loops=7)

66. 1.904 1,332.303 ↓ 522.0 522 7

Nested Loop (cost=7,157.18..17,826.13 rows=1 width=21) (actual time=14.450..190.329 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)))
67. 3.731 1,323.091 ↓ 522.0 522 7

Nested Loop (cost=7,156.90..17,825.80 rows=1 width=25) (actual time=14.441..189.013 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))))
68. 3.423 1,304.744 ↓ 522.0 522 7

Nested Loop (cost=7,156.48..17,766.44 rows=1 width=33) (actual time=14.428..186.392 rows=522 loops=7)

69. 4.039 1,286.705 ↓ 522.0 522 7

Nested Loop (cost=7,156.19..17,766.12 rows=1 width=37) (actual time=14.417..183.815 rows=522 loops=7)

70. 68.915 1,275.358 ↓ 522.0 522 7

Nested Loop (cost=7,155.90..17,765.81 rows=1 width=25) (actual time=14.408..182.194 rows=522 loops=7)

71. 0.056 1,196.048 ↑ 43.0 15 7

Append (cost=7,155.47..16,143.61 rows=645 width=25) (actual time=14.388..170.864 rows=15 loops=7)

72. 0.035 101.234 ↑ 114.6 5 7

Subquery Scan on *SELECT* 1_1 (cost=7,155.47..7,174.09 rows=573 width=25) (actual time=14.387..14.462 rows=5 loops=7)

73. 0.266 101.199 ↑ 114.6 5 7

Unique (cost=7,155.47..7,168.36 rows=573 width=69) (actual time=14.386..14.457 rows=5 loops=7)

74. 0.313 100.933 ↑ 7.6 75 7

Sort (cost=7,155.47..7,156.90 rows=573 width=69) (actual time=14.385..14.419 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
75. 37.508 100.620 ↑ 7.6 75 1

Gather (cost=1,409.74..7,129.22 rows=573 width=69) (actual time=12.005..100.620 rows=75 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
76. 0.709 63.112 ↑ 9.6 25 3 / 3

Hash Join (cost=409.74..6,071.92 rows=239 width=69) (actual time=56.886..63.112 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
77. 0.993 58.334 ↑ 1.3 2,163 3 / 3

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

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
78. 25.630 55.858 ↑ 1.3 2,163 3 / 3

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

79. 1.875 2.105 ↑ 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.343..2.105 rows=2,163 loops=3)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=849
80. 0.230 0.230 ↑ 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.691..0.691 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
81. 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)
82. 0.717 1.483 ↑ 1.0 2,967 3 / 3

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

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

84. 1.115 4.069 ↑ 1.0 3,885 3 / 3

Hash (cost=196.53..196.53 rows=4,041 width=14) (actual time=4.068..4.069 rows=3,885 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 207kB
85. 2.954 2.954 ↑ 1.0 3,885 3 / 3

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

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

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

87. 1.470 921.151 ↑ 5.7 10 7

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

88. 1.267 919.681 ↓ 8.4 480 7

Sort (cost=4,916.66..4,916.80 rows=57 width=69) (actual time=131.351..131.383 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
89. 44.878 918.414 ↓ 8.4 480 1

Nested Loop (cost=266.46..4,915.00 rows=57 width=69) (actual time=317.695..918.414 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
90. 16.286 198.136 ↓ 8.8 61,400 1

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

91. 3.464 11.855 ↓ 24.0 4,857 1

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

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

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

93. 0.234 6.850 ↓ 2.6 607 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
94. 0.771 6.616 ↓ 2.6 607 1

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

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

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

96. 0.320 5.400 ↓ 1.4 630 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
97. 5.080 5.080 ↓ 1.4 630 1

Seq Scan on turma t_3 (cost=0.00..196.53 rows=458 width=14) (actual time=0.038..5.080 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
98. 169.995 169.995 ↑ 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.016..0.035 rows=13 loops=4,857)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
99. 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.011..0.011 rows=0 loops=61,400)

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

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

101. 0.000 84.126 ↓ 0.0 0 7

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

102. 0.026 84.126 ↓ 0.0 0 7

Sort (cost=1,186.57..1,186.58 rows=5 width=69) (actual time=12.017..12.018 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
103. 0.001 84.100 ↓ 0.0 0 1

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

  • Join Filter: (t_4.codigo = turmaagrupada_1.turmaorigem)
104. 2.058 84.099 ↓ 0.0 0 1

Hash Join (cost=266.34..1,183.28 rows=6 width=37) (actual time=84.095..84.099 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
105. 1.942 15.433 ↓ 7.8 4,508 1

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

106. 1.211 4.475 ↓ 7.8 4,508 1

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

107. 0.016 0.016 ↑ 1.0 28 1

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

108. 3.248 3.248 ↓ 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.011..0.116 rows=161 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente.disciplina) AND (professor = 9,959))
109. 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)
110. 0.190 66.608 ↓ 2.6 607 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
111. 64.677 66.418 ↓ 2.6 607 1

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

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

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

113. 0.105 1.492 ↓ 1.4 630 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
114. 1.387 1.387 ↓ 1.4 630 1

Seq Scan on turma t_4 (cost=0.00..196.53 rows=458 width=14) (actual time=0.014..1.387 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
115. 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)
116. 0.007 17.836 ↓ 0.0 0 7

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

117. 0.000 17.829 ↓ 0.0 0 7

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

118. 0.025 17.829 ↓ 0.0 0 7

Sort (cost=1,126.27..1,126.28 rows=4 width=69) (actual time=2.546..2.547 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
119. 0.001 17.804 ↓ 0.0 0 1

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

  • Join Filter: (t_5.codigo = turmaagrupada_2.turmaorigem)
120. 1.225 17.803 ↓ 0.0 0 1

Hash Join (cost=266.34..1,123.54 rows=5 width=37) (actual time=17.799..17.803 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
121. 1.369 12.839 ↓ 7.9 3,839 1

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

122. 0.981 3.792 ↓ 7.9 3,839 1

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

123. 0.011 0.011 ↑ 1.0 28 1

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

124. 2.800 2.800 ↓ 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.009..0.100 rows=137 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente_1.equivalente) AND (professor = 9,959))
125. 7.678 7.678 ↑ 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.002..0.002 rows=1 loops=3,839)

  • Index Cond: (codigo = horarioturmadiaitem_4.horarioturmadia)
126. 0.210 3.739 ↓ 2.6 607 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
127. 0.610 3.529 ↓ 2.6 607 1

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

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

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

129. 0.176 2.570 ↓ 1.4 630 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
130. 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.019..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
131. 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)
132. 0.007 66.437 ↓ 0.0 0 7

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

133. 0.000 66.430 ↓ 0.0 0 7

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

134. 0.028 66.430 ↓ 0.0 0 7

Sort (cost=576.12..576.13 rows=4 width=69) (actual time=9.489..9.490 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
135. 0.001 66.402 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=69) (actual time=66.400..66.402 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))))
136. 0.001 66.401 ↓ 0.0 0 1

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

137. 0.001 66.400 ↓ 0.0 0 1

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

138. 66.399 66.399 ↓ 0.0 0 1

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
139. 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)
140. 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)
141. 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)
142. 0.007 2.114 ↓ 0.0 0 7

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

143. 0.000 2.107 ↓ 0.0 0 7

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

144. 0.023 2.107 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.301..0.301 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
145. 0.001 2.084 ↓ 0.0 0 1

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

  • Join Filter: (horarioturmadiaitem_6.disciplina = disciplinaequivalente_2.disciplina)
146. 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.007..0.011 rows=28 loops=1)

147. 0.010 2.072 ↓ 0.0 0 28

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

148. 0.002 2.062 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.060..2.062 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))))
149. 0.001 2.060 ↓ 0.0 0 1

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

150. 0.001 2.059 ↓ 0.0 0 1

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

151. 2.058 2.058 ↓ 0.0 0 1

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
152. 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)
153. 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)
154. 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)
155. 0.007 3.045 ↓ 0.0 0 7

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

156. 0.000 3.038 ↓ 0.0 0 7

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

157. 0.021 3.038 ↓ 0.0 0 7

Sort (cost=579.06..579.07 rows=1 width=69) (actual time=0.433..0.434 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
158. 0.007 3.017 ↓ 0.0 0 1

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

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

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

160. 0.009 2.996 ↓ 0.0 0 28

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

161. 0.001 2.987 ↓ 0.0 0 1

Nested Loop (cost=1.12..576.08 rows=4 width=33) (actual time=2.985..2.987 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))))
162. 0.002 2.986 ↓ 0.0 0 1

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

163. 0.001 2.984 ↓ 0.0 0 1

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

164. 2.983 2.983 ↓ 0.0 0 1

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,853
165. 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)
166. 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)
167. 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)
168. 10.395 10.395 ↓ 35.0 35 105

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.42..2.51 rows=1 width=21) (actual time=0.010..0.099 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
169. 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)
170. 14.616 14.616 ↑ 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.004..0.004 rows=1 loops=3,654)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
171. 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)
172.          

SubPlan (for Nested Loop)

173. 0.000 0.000 ↓ 0.0 0

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

174. 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))
175. 0.000 0.000 ↓ 0.0 0

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

176. 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))
177. 0.000 0.000 ↓ 0.0 0

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

178. 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))
179. 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))
180. 0.000 0.000 ↓ 0.0 0

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

181. 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)
182. 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)
183. 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
184. 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))
185. 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
186. 0.000 20.034 ↓ 0.0 0 7

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

187. 0.007 20.034 ↓ 0.0 0 7

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

188. 0.014 20.027 ↓ 0.0 0 7

Nested Loop (cost=228.85..979.36 rows=1 width=21) (actual time=2.859..2.861 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))
189. 0.301 20.013 ↓ 0.0 0 7

Nested Loop (cost=1.71..67.30 rows=1 width=17) (actual time=2.859..2.859 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
190. 0.427 19.082 ↓ 45.0 45 7

Nested Loop (cost=1.43..66.98 rows=1 width=21) (actual time=0.041..2.726 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
191. 0.525 3.780 ↓ 51.0 51 7

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

192. 0.280 1.827 ↓ 51.0 51 7

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

193. 0.476 0.476 ↓ 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.008..0.068 rows=51 loops=7)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
194. 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)
195. 1.428 1.428 ↑ 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.004..0.004 rows=1 loops=357)

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
196. 1.785 1.785 ↑ 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.005 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))
197.          

SubPlan (for Nested Loop)

198. 0.000 0.000 ↓ 0.0 0

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

199. 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))
200. 0.000 13.090 ↑ 1.0 1 77

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

201. 13.090 13.090 ↑ 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=0.170..0.170 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
202. 0.000 0.000 ↓ 0.0 0

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

203. 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))
204. 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))
205. 0.000 0.000 ↓ 0.0 0

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

206. 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)
207. 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)
208. 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
209. 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))
210. 0.000 0.000 ↓ 0.0 0

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

211. 0.000 0.000 ↓ 0.0 0

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

212. 0.000 0.000 ↓ 0.0 0

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

213. 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
214. 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))))
215. 0.000 0.000 ↓ 0.0 0

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

216. 0.000 0.000 ↓ 0.0 0

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

217. 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))
218. 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)
219. 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)
220. 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)
221. 0.000 0.000 ↓ 0.0 0

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

222. 0.000 0.000 ↓ 0.0 0

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

223. 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
224. 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))))
225. 0.000 0.000 ↓ 0.0 0

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

226. 0.000 0.000 ↓ 0.0 0

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

227. 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))
228. 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)
229. 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)
230. 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)
231. 0.000 0.000 ↓ 0.0 0

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

232. 0.000 0.000 ↓ 0.0 0

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

233. 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
234. 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)
235. 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))))
236. 0.000 0.000 ↓ 0.0 0

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

237. 0.000 0.000 ↓ 0.0 0

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

238. 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))
239. 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)
240. 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)
241. 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)
242. 0.000 0.000 ↓ 0.0 0

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

243. 0.000 0.000 ↓ 0.0 0

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

244. 0.000 0.000 ↓ 0.0 0

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

245. 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
246. 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)
247. 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))))
248. 0.000 0.000 ↓ 0.0 0

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

249. 0.000 0.000 ↓ 0.0 0

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

250. 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))
251. 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)
252. 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)
253. 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)
254. 0.000 0.000 ↓ 0.0 0

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

255. 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
256. 0.000 0.070 ↓ 0.0 0 7

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

257. 0.007 0.070 ↓ 0.0 0 7

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

258. 0.007 0.063 ↓ 0.0 0 7

Nested Loop (cost=228.85..979.36 rows=1 width=21) (actual time=0.007..0.009 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))
259. 0.007 0.056 ↓ 0.0 0 7

Nested Loop (cost=1.71..67.30 rows=1 width=17) (actual time=0.007..0.008 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)))
260. 0.000 0.049 ↓ 0.0 0 7

Nested Loop (cost=1.43..66.97 rows=1 width=21) (actual time=0.007..0.007 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))))
261. 0.007 0.049 ↓ 0.0 0 7

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

262. 0.000 0.042 ↓ 0.0 0 7

Nested Loop (cost=0.72..5.16 rows=1 width=33) (actual time=0.006..0.006 rows=0 loops=7)

263. 0.042 0.042 ↓ 0.0 0 7

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

  • Index Cond: ((turmateorica IS NOT NULL) AND (turmateorica IS NOT NULL))
264. 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)
265. 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)
266. 0.000 0.000 ↓ 0.0 0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_3 (cost=0.42..2.64 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)
267.          

SubPlan (for Nested Loop)

268. 0.000 0.000 ↓ 0.0 0

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

269. 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))
270. 0.000 0.000 ↓ 0.0 0

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

271. 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))
272. 0.000 0.000 ↓ 0.0 0

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

273. 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))
274. 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))
275. 0.000 0.000 ↓ 0.0 0

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

276. 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)
277. 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)
278. 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
279. 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))
280. 0.000 0.000 ↓ 0.0 0

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

281. 0.000 0.000 ↓ 0.0 0

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

282. 0.000 0.000 ↓ 0.0 0

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

283. 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
284. 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))))
285. 0.000 0.000 ↓ 0.0 0

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

286. 0.000 0.000 ↓ 0.0 0

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

287. 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))
288. 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)
289. 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)
290. 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)
291. 0.000 0.000 ↓ 0.0 0

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

292. 0.000 0.000 ↓ 0.0 0

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

293. 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
294. 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))))
295. 0.000 0.000 ↓ 0.0 0

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

296. 0.000 0.000 ↓ 0.0 0

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

297. 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))
298. 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)
299. 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)
300. 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)
301. 0.000 0.000 ↓ 0.0 0

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

302. 0.000 0.000 ↓ 0.0 0

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

303. 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
304. 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)
305. 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))))
306. 0.000 0.000 ↓ 0.0 0

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

307. 0.000 0.000 ↓ 0.0 0

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

308. 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))
309. 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)
310. 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)
311. 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)
312. 0.000 0.000 ↓ 0.0 0

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

313. 0.000 0.000 ↓ 0.0 0

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

314. 0.000 0.000 ↓ 0.0 0

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

315. 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
316. 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)
317. 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))))
318. 0.000 0.000 ↓ 0.0 0

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

319. 0.000 0.000 ↓ 0.0 0

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

320. 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))
321. 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)
322. 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)
323. 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)
324. 0.000 0.000 ↓ 0.0 0

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

325. 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
326. 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)
327.          

SubPlan (for GroupAggregate)

328. 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
329. 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 : 216.801 ms
Execution time : 1,692.004 ms