explain.depesz.com

PostgreSQL's explain analyze made readable

Result: J0BH

Settings
# exclusive inclusive rows x rows loops node
1. 0.019 2,724.144 ↑ 1.0 1 1

Aggregate (cost=29,913.52..29,913.53 rows=1 width=32) (actual time=2,724.142..2,724.144 rows=1 loops=1)

2. 0.024 2,724.125 ↓ 7.0 7 1

Unique (cost=29,913.45..29,913.50 rows=1 width=556) (actual time=2,724.097..2,724.125 rows=7 loops=1)

3. 0.038 2,724.101 ↓ 7.0 7 1

Sort (cost=29,913.45..29,913.46 rows=1 width=556) (actual time=2,724.094..2,724.101 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. 1.574 2,724.063 ↓ 7.0 7 1

GroupAggregate (cost=29,905.09..29,913.44 rows=1 width=556) (actual time=2,721.839..2,724.063 rows=7 loops=1)

  • Group Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
5. 3.202 2,721.970 ↓ 519.0 519 1

Sort (cost=29,905.09..29,905.10 rows=1 width=537) (actual time=2,721.510..2,721.970 rows=519 loops=1)

  • Sort Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
  • Sort Method: quicksort Memory: 552kB
6. 3.162 2,718.768 ↓ 519.0 519 1

Nested Loop Left Join (cost=10,993.42..29,905.08 rows=1 width=537) (actual time=760.063..2,718.768 rows=519 loops=1)

  • Join Filter: (atividadediscursivarespostaaluno.matriculaperiodoturmadisciplina = "*SELECT* 1".matriculaperiodoturmadisciplina)
  • Rows Removed by Join Filter: 989
7. 6.129 2,711.454 ↓ 519.0 519 1

Nested Loop Left Join (cost=10,993.14..29,901.55 rows=1 width=504) (actual time=759.987..2,711.454 rows=519 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,289
8. 0.050 310.352 ↓ 7.0 7 1

Nested Loop (cost=10,928.83..10,944.23 rows=1 width=518) (actual time=309.527..310.352 rows=7 loops=1)

  • Join Filter: (atividadediscursiva.turma = turma.codigo)
9. 0.073 310.204 ↓ 7.0 7 1

Nested Loop (cost=10,928.55..10,942.98 rows=1 width=493) (actual time=309.482..310.204 rows=7 loops=1)

  • Join Filter: (atividadediscursiva.disciplina = disciplina.codigo)
10. 0.816 309.984 ↓ 7.0 7 1

Merge Join (cost=10,928.27..10,942.51 rows=1 width=463) (actual time=309.396..309.984 rows=7 loops=1)

  • Merge Cond: ((atividadediscursiva.turma = horarioprofessor.turma) AND (atividadediscursiva.disciplina = horarioprofessor.disciplina) AND ((atividadediscursiva.ano)::text = (horarioprofessor.ano)::text) AND ((atividadediscursiva.semestre)::text = (horarioprofessor.semestre)::text))
11. 1.987 2.735 ↑ 1.0 477 1

Sort (cost=69.05..70.25 rows=478 width=455) (actual time=2.201..2.735 rows=477 loops=1)

  • Sort Key: atividadediscursiva.turma, atividadediscursiva.disciplina, atividadediscursiva.ano, atividadediscursiva.semestre
  • Sort Method: quicksort Memory: 338kB
12. 0.748 0.748 ↑ 1.0 478 1

Seq Scan on atividadediscursiva (cost=0.00..47.78 rows=478 width=455) (actual time=0.019..0.748 rows=478 loops=1)

13. 0.065 306.433 ↑ 66.0 10 1

Sort (cost=10,859.22..10,860.87 rows=660 width=13) (actual time=306.414..306.433 rows=10 loops=1)

  • Sort Key: horarioprofessor.turma, horarioprofessor.disciplina, horarioprofessor.ano, horarioprofessor.semestre
  • Sort Method: quicksort Memory: 25kB
14. 0.029 306.368 ↑ 66.0 10 1

Subquery Scan on horarioprofessor (cost=10,806.86..10,828.31 rows=660 width=13) (actual time=305.526..306.368 rows=10 loops=1)

15. 0.510 306.339 ↑ 66.0 10 1

Unique (cost=10,806.86..10,821.71 rows=660 width=69) (actual time=305.520..306.339 rows=10 loops=1)

16. 1.345 305.829 ↑ 2.1 315 1

Sort (cost=10,806.86..10,808.51 rows=660 width=69) (actual time=305.516..305.829 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
17. 9.577 304.484 ↑ 2.1 315 1

Hash Join (cost=7,250.27..10,775.95 rows=660 width=69) (actual time=198.525..304.484 rows=315 loops=1)

  • 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: 6,175
18. 14.850 278.246 ↑ 1.1 6,490 1

Hash Join (cost=6,999.07..10,506.72 rows=6,871 width=25) (actual time=26.823..278.246 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
19. 131.445 256.651 ↑ 1.1 6,490 1

Hash Join (cost=6,907.25..10,396.84 rows=6,871 width=16) (actual time=20.000..256.651 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.codigo = horarioturmadiaitem.horarioturmadia)
20. 105.643 105.643 ↓ 1.0 102,812 1

Seq Scan on horarioturmadia (cost=0.00..2,649.93 rows=102,793 width=8) (actual time=0.008..105.643 rows=102,812 loops=1)

21. 7.775 19.563 ↑ 1.1 6,490 1

Hash (cost=6,821.36..6,821.36 rows=6,871 width=16) (actual time=19.562..19.563 rows=6,490 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
22. 10.957 11.788 ↑ 1.1 6,490 1

Bitmap Heap Scan on horarioturmadiaitem (cost=129.67..6,821.36 rows=6,871 width=16) (actual time=1.064..11.788 rows=6,490 loops=1)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,217
23. 0.831 0.831 ↑ 1.1 6,490 1

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..127.95 rows=6,871 width=0) (actual time=0.830..0.831 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
24. 3.452 6.745 ↑ 1.0 2,970 1

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=6.744..6.745 rows=2,970 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 171kB
25. 3.293 3.293 ↑ 1.0 2,970 1

Seq Scan on horarioturma (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.015..3.293 rows=2,970 loops=1)

26. 7.208 16.661 ↓ 1.3 5,856 1

Hash (cost=194.56..194.56 rows=4,531 width=14) (actual time=16.660..16.661 rows=5,856 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 326kB
27. 9.453 9.453 ↓ 1.3 5,856 1

Seq Scan on turma t (cost=0.00..194.56 rows=4,531 width=14) (actual time=0.016..9.453 rows=5,856 loops=1)

  • Filter: (semestral OR anual OR ((NOT semestral) AND (NOT anual)))
28. 0.147 0.147 ↑ 1.0 1 7

Index Scan using disciplina_pkey on disciplina (cost=0.28..0.46 rows=1 width=34) (actual time=0.021..0.021 rows=1 loops=7)

  • Index Cond: (codigo = horarioprofessor.disciplina)
29. 0.098 0.098 ↑ 1.0 1 7

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

  • Index Cond: (codigo = horarioprofessor.turma)
30. 7.511 2,394.973 ↓ 136.0 544 7

Append (cost=64.31..18,957.22 rows=4 width=17) (actual time=183.609..342.139 rows=544 loops=7)

31. 0.014 60.781 ↓ 0.0 0 7

Subquery Scan on *SELECT* 1 (cost=64.31..322.09 rows=1 width=17) (actual time=8.683..8.683 rows=0 loops=7)

32. 0.014 60.767 ↓ 0.0 0 7

Nested Loop (cost=64.31..322.08 rows=1 width=155) (actual time=8.681..8.681 rows=0 loops=7)

33. 3.822 60.753 ↓ 0.0 0 7

Nested Loop (cost=64.01..317.76 rows=1 width=21) (actual time=8.679..8.679 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
34. 4.515 51.611 ↓ 152.0 152 7

Nested Loop (cost=63.74..317.44 rows=1 width=25) (actual time=0.510..7.373 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
35. 4.200 37.268 ↓ 156.0 156 7

Nested Loop (cost=63.31..176.48 rows=1 width=45) (actual time=0.483..5.324 rows=156 loops=7)

36. 3.745 17.780 ↓ 156.0 156 7

Nested Loop (cost=63.02..176.12 rows=1 width=49) (actual time=0.458..2.540 rows=156 loops=7)

37. 2.520 8.575 ↓ 156.0 156 7

Nested Loop (cost=62.73..172.64 rows=1 width=37) (actual time=0.442..1.225 rows=156 loops=7)

38. 0.252 2.688 ↑ 1.0 13 7

Unique (cost=62.31..62.60 rows=13 width=92) (actual time=0.334..0.384 rows=13 loops=7)

39. 0.194 2.436 ↑ 1.0 13 7

Sort (cost=62.31..62.34 rows=13 width=92) (actual time=0.332..0.348 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
40. 0.061 2.242 ↑ 1.0 13 1

Nested Loop Left Join (cost=22.53..62.07 rows=13 width=92) (actual time=1.375..2.242 rows=13 loops=1)

41. 1.034 2.103 ↑ 1.0 13 1

Hash Join (cost=22.25..49.89 rows=13 width=44) (actual time=1.330..2.103 rows=13 loops=1)

  • Hash Cond: (programacaotutoriaonline.codigo = programacaotutoriaonlineprofessor.programacaotutoriaonline)
42. 0.880 0.880 ↑ 1.0 967 1

Seq Scan on programacaotutoriaonline (cost=0.00..22.67 rows=967 width=40) (actual time=0.014..0.880 rows=967 loops=1)

43. 0.036 0.189 ↑ 1.0 13 1

Hash (cost=22.09..22.09 rows=13 width=12) (actual time=0.188..0.189 rows=13 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
44. 0.153 0.153 ↑ 1.0 13 1

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..22.09 rows=13 width=12) (actual time=0.099..0.153 rows=13 loops=1)

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

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

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

Index Scan using idx_mptd_programacaotutoriaonlineprofessor on matriculaperiodoturmadisciplina (cost=0.42..8.45 rows=1 width=37) (actual time=0.005..0.037 rows=12 loops=91)

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

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

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

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

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

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.42..7.22 rows=1 width=49) (actual time=0.007..0.009 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))
50.          

SubPlan (for Nested Loop)

51. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.25..29.28 rows=1 width=4) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his (cost=25.25..29.28 rows=1 width=4) (never executed)

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

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

54. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = historico.disciplina)
56. 0.000 0.000 ↓ 0.0 0

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

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

Nested Loop (cost=74.42..78.46 rows=1 width=0) (never executed)

59. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.16..49.17 rows=1 width=25) (never executed)

  • Group Key: (his_2.matricula)::text, (his_2.anohistorico)::text, (his_2.semestrehistorico)::text, his_2.disciplina, his_2.transferenciamatrizcurricularmatricula
60. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (((matricula)::text = (historico.matricula)::text) AND (matrizcurricular = matricula.gradecurricularatual))
  • Filter: ((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia))
61. 0.000 0.000 ↓ 0.0 0

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

62. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_gc (cost=0.00..40.20 rows=2,104 width=0) (never executed)

  • Index Cond: (matrizcurricular = matricula.gradecurricularatual)
64. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico hist (cost=25.25..29.28 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico.matricula)::text) AND (disciplina = his_2.disciplina))
  • Filter: (historicoporequivalencia AND (historico.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico.numeroagrupamentoequivalenciadisciplina) AND ((his_2.anohistorico)::text = (anohistorico)::text) AND ((his_2.semestrehistorico)::text = (semestrehistorico)::text) AND (his_2.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
65. 0.000 0.000 ↓ 0.0 0

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

66. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = his_2.disciplina)
68. 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..4.45 rows=1 width=4) (never executed)

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

Index Scan using curso_pkey on curso (cost=0.28..0.30 rows=1 width=6) (actual time=0.004..0.005 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))
70. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
71. 7.840 2,285.311 ↓ 544.0 544 7

Subquery Scan on *SELECT* 2 (cost=7,825.83..16,394.08 rows=1 width=17) (actual time=174.921..326.473 rows=544 loops=7)

72. 16.310 2,277.471 ↓ 544.0 544 7

Nested Loop (cost=7,825.83..16,394.07 rows=1 width=155) (actual time=174.918..325.353 rows=544 loops=7)

73. 17.934 2,242.121 ↓ 544.0 544 7

Nested Loop (cost=7,825.53..16,389.75 rows=1 width=21) (actual time=174.901..320.303 rows=544 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)))
74. 17.787 2,208.955 ↓ 544.0 544 7

Nested Loop (cost=7,825.26..16,389.42 rows=1 width=25) (actual time=174.883..315.565 rows=544 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))))
75. 14.294 2,149.280 ↓ 544.0 544 7

Nested Loop (cost=7,824.83..16,255.01 rows=1 width=45) (actual time=174.855..307.040 rows=544 loops=7)

76. 14.623 2,074.058 ↓ 544.0 544 7

Nested Loop (cost=7,824.54..16,254.64 rows=1 width=49) (actual time=174.824..296.294 rows=544 loops=7)

77. 1,076.593 2,036.587 ↓ 544.0 544 7

Gather (cost=7,824.25..16,254.32 rows=1 width=37) (actual time=174.799..290.941 rows=544 loops=7)

  • Workers Planned: 2
  • Workers Launched: 2
78. 2.863 959.994 ↓ 181.0 181 21 / 3

Nested Loop (cost=6,824.25..15,254.22 rows=1 width=37) (actual time=120.633..137.142 rows=181 loops=21)

79. 0.117 943.481 ↑ 55.0 5 21 / 3

Parallel Append (cost=6,823.83..13,057.32 rows=275 width=25) (actual time=120.564..134.783 rows=5 loops=21)

80. 0.042 344.437 ↑ 117.8 5 7 / 3

Subquery Scan on *SELECT* 1_1 (cost=10,796.97..10,816.11 rows=589 width=25) (actual time=147.408..147.616 rows=5 loops=7)

81. 0.285 344.395 ↑ 117.8 5 7 / 3

Unique (cost=10,796.97..10,810.22 rows=589 width=69) (actual time=147.401..147.598 rows=5 loops=7)

82. 0.587 344.111 ↑ 7.9 75 7 / 3

Sort (cost=10,796.97..10,798.44 rows=589 width=69) (actual time=147.398..147.476 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
  • Worker 0: Sort Method: quicksort Memory: 35kB
  • Worker 1: Sort Method: quicksort Memory: 35kB
83. 8.531 343.524 ↑ 7.9 75 3 / 3

Hash Join (cost=7,244.18..10,769.87 rows=589 width=69) (actual time=212.987..343.524 rows=75 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: 3,923
84. 14.788 319.433 ↑ 1.1 6,490 3 / 3

Hash Join (cost=6,999.07..10,506.72 rows=6,871 width=25) (actual time=40.357..319.433 rows=6,490 loops=3)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
85. 136.285 296.657 ↑ 1.1 6,490 3 / 3

Hash Join (cost=6,907.25..10,396.84 rows=6,871 width=16) (actual time=32.287..296.657 rows=6,490 loops=3)

  • Hash Cond: (horarioturmadia_1.codigo = horarioturmadiaitem_1.horarioturmadia)
86. 128.628 128.628 ↓ 1.0 102,812 3 / 3

Seq Scan on horarioturmadia horarioturmadia_1 (cost=0.00..2,649.93 rows=102,793 width=8) (actual time=0.038..128.628 rows=102,812 loops=3)

87. 8.727 31.744 ↑ 1.1 6,490 3 / 3

Hash (cost=6,821.36..6,821.36 rows=6,871 width=16) (actual time=31.743..31.744 rows=6,490 loops=3)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
88. 21.927 23.017 ↑ 1.1 6,490 3 / 3

Bitmap Heap Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=129.67..6,821.36 rows=6,871 width=16) (actual time=1.353..23.017 rows=6,490 loops=3)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,217
89. 1.090 1.090 ↑ 1.1 6,490 3 / 3

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..127.95 rows=6,871 width=0) (actual time=1.089..1.090 rows=6,490 loops=3)

  • Index Cond: (professor = 9,959)
90. 3.863 7.988 ↑ 1.0 2,970 3 / 3

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=7.986..7.988 rows=2,970 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 171kB
91. 4.125 4.125 ↑ 1.0 2,970 3 / 3

Seq Scan on horarioturma horarioturma_1 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.084..4.125 rows=2,970 loops=3)

92. 5.367 15.560 ↑ 1.0 3,888 3 / 3

Hash (cost=194.56..194.56 rows=4,044 width=14) (actual time=15.559..15.560 rows=3,888 loops=3)

  • Buckets: 4,096 Batches: 1 Memory Usage: 207kB
93. 10.193 10.193 ↑ 1.0 3,888 3 / 3

Seq Scan on turma t_2 (cost=0.00..194.56 rows=4,044 width=14) (actual time=0.195..10.193 rows=3,888 loops=3)

  • Filter: ((NOT turmaagrupada) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 1,968
94. 0.068 549.528 ↑ 5.8 10 7 / 3

Subquery Scan on *SELECT* 2_1 (cost=6,823.83..6,825.86 rows=58 width=25) (actual time=234.299..235.512 rows=10 loops=7)

95. 1.685 549.460 ↑ 5.8 10 7 / 3

Unique (cost=6,823.83..6,825.28 rows=58 width=69) (actual time=234.295..235.483 rows=10 loops=7)

96. 2.378 547.776 ↓ 8.3 480 7 / 3

Sort (cost=6,823.83..6,823.97 rows=58 width=69) (actual time=234.293..234.761 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
  • Worker 0: Sort Method: quicksort Memory: 92kB
97. 109.144 545.398 ↓ 8.3 480 2 / 3

Nested Loop (cost=266.41..6,822.13 rows=58 width=69) (actual time=336.199..818.097 rows=480 loops=2)

  • 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
98. 95.750 190.618 ↓ 8.8 61,409 2 / 3

Nested Loop (cost=265.98..1,138.50 rows=7,009 width=31) (actual time=15.333..285.927 rows=61,409 loops=2)

99. 9.403 23.632 ↓ 24.0 4,857 2 / 3

Hash Join (cost=265.69..367.92 rows=202 width=27) (actual time=15.182..35.448 rows=4,857 loops=2)

  • Hash Cond: (turmaagrupada.turmaorigem = t_3.codigo)
100. 4.240 4.240 ↑ 1.0 5,106 2 / 3

Seq Scan on turmaagrupada (cost=0.00..81.06 rows=5,106 width=8) (actual time=0.060..6.360 rows=5,106 loops=2)

101. 0.599 9.989 ↓ 2.6 607 2 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=14.982..14.983 rows=607 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
102. 2.805 9.389 ↓ 2.6 607 2 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=6.644..14.084 rows=607 loops=2)

  • Hash Cond: (horarioturma_2.turma = t_3.codigo)
103. 2.268 2.268 ↑ 1.0 2,970 2 / 3

Seq Scan on horarioturma horarioturma_2 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.052..3.402 rows=2,970 loops=2)

104. 0.576 4.317 ↓ 1.4 630 2 / 3

Hash (cost=194.56..194.56 rows=458 width=14) (actual time=6.474..6.475 rows=630 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
105. 3.741 3.741 ↓ 1.4 630 2 / 3

Seq Scan on turma t_3 (cost=0.00..194.56 rows=458 width=14) (actual time=0.061..5.611 rows=630 loops=2)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,226
106. 71.236 71.236 ↑ 2.9 13 9,714 / 3

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_2 (cost=0.29..3.43 rows=38 width=8) (actual time=0.005..0.022 rows=13 loops=9,714)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
107. 245.636 245.636 ↓ 0.0 0 122,818 / 3

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem horarioturmadiaitem_2 (cost=0.42..0.79 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=122,818)

  • Index Cond: (horarioturmadia = horarioturmadia_2.codigo)
  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 4
108. 0.005 24.712 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 3_1 (cost=3,181.42..3,181.61 rows=5 width=25) (actual time=10.591..10.591 rows=0 loops=7)

109. 0.005 24.708 ↓ 0.0 0 7 / 3

Unique (cost=3,181.42..3,181.56 rows=5 width=69) (actual time=10.589..10.589 rows=0 loops=7)

110. 0.021 24.703 ↓ 0.0 0 7 / 3

Sort (cost=3,181.42..3,181.44 rows=5 width=69) (actual time=10.587..10.587 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
111. 0.001 24.682 ↓ 0.0 0 1 / 3

Nested Loop (cost=266.69..3,181.37 rows=5 width=69) (actual time=74.044..74.045 rows=0 loops=1)

  • Join Filter: (t_4.codigo = turmaagrupada_1.turmaorigem)
112. 2.506 24.681 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,177.86 rows=6 width=37) (actual time=74.041..74.042 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
113. 5.446 17.744 ↓ 7.6 4,508 1 / 3

Nested Loop (cost=0.71..2,908.80 rows=590 width=20) (actual time=0.095..53.233 rows=4,508 loops=1)

114. 3.146 6.287 ↓ 7.6 4,508 1 / 3

Nested Loop (cost=0.42..2,071.59 rows=590 width=20) (actual time=0.071..18.862 rows=4,508 loops=1)

115. 0.015 0.015 ↑ 1.0 28 1 / 3

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

116. 3.127 3.127 ↓ 8.9 161 28 / 3

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_3 (cost=0.42..73.76 rows=18 width=16) (actual time=0.008..0.335 rows=161 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente.disciplina) AND (professor = 9,959))
117. 6.011 6.011 ↑ 1.0 1 4,508 / 3

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

  • Index Cond: (codigo = horarioturmadiaitem_3.horarioturmadia)
118. 0.295 4.430 ↓ 2.6 607 1 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=13.290..13.291 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
119. 1.393 4.136 ↓ 2.6 607 1 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=5.199..12.407 rows=607 loops=1)

  • Hash Cond: (horarioturma_3.turma = t_4.codigo)
120. 1.049 1.049 ↑ 1.0 2,970 1 / 3

Seq Scan on horarioturma horarioturma_3 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.010..3.148 rows=2,970 loops=1)

121. 0.290 1.693 ↓ 1.4 630 1 / 3

Hash (cost=194.56..194.56 rows=458 width=14) (actual time=5.078..5.080 rows=630 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
122. 1.403 1.403 ↓ 1.4 630 1 / 3

Seq Scan on turma t_4 (cost=0.00..194.56 rows=458 width=14) (actual time=0.029..4.210 rows=630 loops=1)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,226
123. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (turmaorigem = horarioturma_3.turma)
124. 0.005 21.117 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 4_1 (cost=3,048.33..3,048.48 rows=4 width=25) (actual time=9.050..9.050 rows=0 loops=7)

125. 0.005 21.112 ↓ 0.0 0 7 / 3

Unique (cost=3,048.33..3,048.44 rows=4 width=69) (actual time=9.048..9.048 rows=0 loops=7)

126. 0.019 21.107 ↓ 0.0 0 7 / 3

Sort (cost=3,048.33..3,048.34 rows=4 width=69) (actual time=9.046..9.046 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
127. 0.001 21.088 ↓ 0.0 0 1 / 3

Nested Loop (cost=266.69..3,048.29 rows=4 width=69) (actual time=63.264..63.265 rows=0 loops=1)

  • Join Filter: (t_5.codigo = turmaagrupada_2.turmaorigem)
128. 1.847 21.087 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,045.37 rows=5 width=37) (actual time=63.261..63.262 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
129. 4.256 14.752 ↓ 7.7 3,839 1 / 3

Nested Loop (cost=0.71..2,776.84 rows=497 width=20) (actual time=0.142..44.255 rows=3,839 loops=1)

130. 2.553 5.377 ↓ 7.7 3,839 1 / 3

Nested Loop (cost=0.42..2,071.59 rows=497 width=20) (actual time=0.107..16.130 rows=3,839 loops=1)

131. 0.014 0.014 ↑ 1.0 28 1 / 3

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

132. 2.809 2.809 ↓ 7.6 137 28 / 3

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_4 (cost=0.42..73.76 rows=18 width=16) (actual time=0.008..0.301 rows=137 loops=28)

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

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

  • Index Cond: (codigo = horarioturmadiaitem_4.horarioturmadia)
134. 0.321 4.488 ↓ 2.6 607 1 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=13.464..13.465 rows=607 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
135. 1.546 4.167 ↓ 2.6 607 1 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=4.821..12.502 rows=607 loops=1)

  • Hash Cond: (horarioturma_4.turma = t_5.codigo)
136. 1.056 1.056 ↑ 1.0 2,970 1 / 3

Seq Scan on horarioturma horarioturma_4 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.009..3.168 rows=2,970 loops=1)

137. 0.292 1.565 ↓ 1.4 630 1 / 3

Hash (cost=194.56..194.56 rows=458 width=14) (actual time=4.694..4.695 rows=630 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
138. 1.273 1.273 ↓ 1.4 630 1 / 3

Seq Scan on turma t_5 (cost=0.00..194.56 rows=458 width=14) (actual time=0.036..3.819 rows=630 loops=1)

  • Filter: (turmaagrupada AND (NOT subturma) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,226
139. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (turmaorigem = horarioturma_4.turma)
140. 0.005 1.148 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 7 (cost=728.08..728.12 rows=1 width=25) (actual time=0.492..0.492 rows=0 loops=7)

141. 0.005 1.143 ↓ 0.0 0 7 / 3

Unique (cost=728.08..728.11 rows=1 width=69) (actual time=0.490..0.490 rows=0 loops=7)

142. 0.022 1.139 ↓ 0.0 0 7 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=0.488..0.488 rows=0 loops=7)

  • Sort Key: horarioturma_5.codigo, t_6.codigo, t_6.subturma, t_6.tiposubturma, t_6.turmaagrupada, disciplinaequivalente_2.disciplina, horarioturma_5.anovigente, horarioturma_5.semestrevigente, horarioturmadiaitem_5.disciplina
  • Sort Method: quicksort Memory: 25kB
143. 0.001 1.116 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.78..728.07 rows=1 width=69) (actual time=3.348..3.349 rows=0 loops=1)

144. 0.001 1.115 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=3.345..3.346 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))))
145. 0.001 1.114 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.22..314.65 rows=509 width=31) (actual time=3.342..3.343 rows=0 loops=1)

146. 0.018 1.114 ↓ 0.0 0 1 / 3

Hash Join (cost=194.92..257.43 rows=15 width=27) (actual time=3.340..3.341 rows=0 loops=1)

  • Hash Cond: (horarioturma_5.turma = t_6.codigo)
147. 0.004 0.004 ↑ 2,970.0 1 1 / 3

Seq Scan on horarioturma horarioturma_5 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.012..0.013 rows=1 loops=1)

148. 0.001 1.091 ↓ 0.0 0 1 / 3

Hash (cost=194.56..194.56 rows=29 width=14) (actual time=3.272..3.273 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
149. 1.090 1.090 ↓ 0.0 0 1 / 3

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
150. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturma = horarioturma_5.codigo)
151. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturmadia = horarioturmadia_5.codigo)
  • Filter: (professor = 9,959)
152. 0.000 0.000 ↓ 0.0 0 / 3

Index Scan using idx_disciplinaequivalente_equivalente on disciplinaequivalente disciplinaequivalente_2 (cost=0.14..0.16 rows=1 width=8) (never executed)

  • Index Cond: (equivalente = horarioturmadiaitem_5.disciplina)
153. 0.005 1.211 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 6 (cost=728.08..728.11 rows=1 width=25) (actual time=0.519..0.519 rows=0 loops=7)

154. 0.007 1.206 ↓ 0.0 0 7 / 3

Unique (cost=728.08..728.10 rows=1 width=69) (actual time=0.517..0.517 rows=0 loops=7)

155. 0.023 1.199 ↓ 0.0 0 7 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=0.513..0.514 rows=0 loops=7)

  • Sort Key: horarioturma_6.codigo, t_7.codigo, t_7.subturma, t_7.tiposubturma, t_7.turmaagrupada, disciplinaequivalente_3.equivalente, horarioturma_6.anovigente, horarioturma_6.semestrevigente, horarioturmadiaitem_6.disciplina
  • Sort Method: quicksort Memory: 25kB
156. 0.001 1.176 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.78..728.07 rows=1 width=69) (actual time=3.528..3.529 rows=0 loops=1)

157. 0.001 1.175 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=3.525..3.526 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))))
158. 0.001 1.175 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.22..314.65 rows=509 width=31) (actual time=3.523..3.524 rows=0 loops=1)

159. 0.022 1.174 ↓ 0.0 0 1 / 3

Hash Join (cost=194.92..257.43 rows=15 width=27) (actual time=3.521..3.522 rows=0 loops=1)

  • Hash Cond: (horarioturma_6.turma = t_7.codigo)
160. 0.011 0.011 ↑ 2,970.0 1 1 / 3

Seq Scan on horarioturma horarioturma_6 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.031..0.032 rows=1 loops=1)

161. 0.001 1.141 ↓ 0.0 0 1 / 3

Hash (cost=194.56..194.56 rows=29 width=14) (actual time=3.423..3.424 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
162. 1.140 1.140 ↓ 0.0 0 1 / 3

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
163. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturma = horarioturma_6.codigo)
164. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturmadia = horarioturmadia_6.codigo)
  • Filter: (professor = 9,959)
165. 0.000 0.000 ↓ 0.0 0 / 3

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_3 (cost=0.14..0.16 rows=1 width=8) (never executed)

  • Index Cond: (disciplina = horarioturmadiaitem_6.disciplina)
  • Heap Fetches: 0
166. 0.005 1.211 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 5 (cost=727.44..727.57 rows=4 width=25) (actual time=0.519..0.519 rows=0 loops=7)

167. 0.005 1.206 ↓ 0.0 0 7 / 3

Unique (cost=727.44..727.53 rows=4 width=69) (actual time=0.517..0.517 rows=0 loops=7)

168. 0.024 1.202 ↓ 0.0 0 7 / 3

Sort (cost=727.44..727.45 rows=4 width=69) (actual time=0.515..0.515 rows=0 loops=7)

  • Sort Key: horarioturma_7.codigo, t_8.codigo, t_8.subturma, t_8.tiposubturma, t_8.turmaagrupada, horarioturmadiaitem_7.disciplina, horarioturma_7.anovigente, horarioturma_7.semestrevigente
  • Sort Method: quicksort Memory: 25kB
169. 0.001 1.178 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=69) (actual time=3.533..3.534 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))))
170. 0.001 1.177 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.22..314.65 rows=509 width=31) (actual time=3.530..3.531 rows=0 loops=1)

171. 0.018 1.176 ↓ 0.0 0 1 / 3

Hash Join (cost=194.92..257.43 rows=15 width=27) (actual time=3.528..3.528 rows=0 loops=1)

  • Hash Cond: (horarioturma_7.turma = t_8.codigo)
172. 0.009 0.009 ↑ 2,970.0 1 1 / 3

Seq Scan on horarioturma horarioturma_7 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.027..0.028 rows=1 loops=1)

173. 0.002 1.148 ↓ 0.0 0 1 / 3

Hash (cost=194.56..194.56 rows=29 width=14) (actual time=3.444..3.445 rows=0 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
174. 1.146 1.146 ↓ 0.0 0 1 / 3

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
175. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturma = horarioturma_7.codigo)
176. 0.000 0.000 ↓ 0.0 0 / 3

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

  • Index Cond: (horarioturmadia = horarioturmadia_7.codigo)
  • Filter: (professor = 9,959)
177. 13.650 13.650 ↓ 36.0 36 105 / 3

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.42..7.98 rows=1 width=33) (actual time=0.036..0.390 rows=36 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
178. 22.848 22.848 ↑ 1.0 1 3,808

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_1 (cost=0.29..0.32 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=3,808)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
179. 60.928 60.928 ↑ 1.0 1 3,808

Index Scan using matricula_pkey on matricula matricula_1 (cost=0.29..0.37 rows=1 width=20) (actual time=0.016..0.016 rows=1 loops=3,808)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
180. 41.888 41.888 ↑ 1.0 1 3,808

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_1 (cost=0.42..0.68 rows=1 width=49) (actual time=0.009..0.011 rows=1 loops=3,808)

  • 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))
181.          

SubPlan (for Nested Loop)

182. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.25..29.28 rows=1 width=4) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_4 (cost=25.25..29.28 rows=1 width=4) (never executed)

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

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

185. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = historico_1.disciplina)
187. 0.000 0.000 ↓ 0.0 0

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

188. 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..50.64 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))
189. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=74.42..78.46 rows=1 width=0) (never executed)

190. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.16..49.17 rows=1 width=25) (never executed)

  • Group Key: (his_6.matricula)::text, (his_6.anohistorico)::text, (his_6.semestrehistorico)::text, his_6.disciplina, his_6.transferenciamatrizcurricularmatricula
191. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (((matricula)::text = (historico_1.matricula)::text) AND (matrizcurricular = matricula_1.gradecurricularatual))
  • Filter: ((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia))
192. 0.000 0.000 ↓ 0.0 0

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

193. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_gc (cost=0.00..40.20 rows=2,104 width=0) (never executed)

  • Index Cond: (matrizcurricular = matricula_1.gradecurricularatual)
195. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico hist_1 (cost=25.25..29.28 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_1.matricula)::text) AND (disciplina = his_6.disciplina))
  • Filter: (historicoporequivalencia AND (historico_1.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_1.numeroagrupamentoequivalenciadisciplina) AND ((his_6.anohistorico)::text = (anohistorico)::text) AND ((his_6.semestrehistorico)::text = (semestrehistorico)::text) AND (his_6.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
196. 0.000 0.000 ↓ 0.0 0

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

197. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = his_6.disciplina)
199. 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..4.45 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
200. 15.232 15.232 ↑ 1.0 1 3,808

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

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

Index Only Scan using pessoa_pkey on pessoa professor_1 (cost=0.29..4.31 rows=1 width=4) (actual time=0.004..0.005 rows=1 loops=3,808)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
202. 0.021 41.181 ↓ 0.0 0 7

Subquery Scan on *SELECT* 3 (cost=240.26..1,120.51 rows=1 width=17) (actual time=5.882..5.883 rows=0 loops=7)

203. 0.028 41.160 ↓ 0.0 0 7

Nested Loop (cost=240.26..1,120.50 rows=1 width=155) (actual time=5.880..5.880 rows=0 loops=7)

204. 0.014 41.132 ↓ 0.0 0 7

Nested Loop (cost=239.97..1,116.18 rows=1 width=21) (actual time=5.876..5.876 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))
205. 1.141 41.118 ↓ 0.0 0 7

Nested Loop (cost=1.71..159.63 rows=1 width=17) (actual time=5.874..5.874 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
206. 1.750 38.087 ↓ 45.0 45 7

Nested Loop (cost=1.43..159.30 rows=1 width=21) (actual time=0.083..5.441 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
207. 1.463 10.976 ↓ 51.0 51 7

Nested Loop (cost=1.01..17.12 rows=1 width=41) (actual time=0.061..1.568 rows=51 loops=7)

208. 1.645 4.515 ↓ 51.0 51 7

Nested Loop (cost=0.72..16.76 rows=1 width=45) (actual time=0.033..0.645 rows=51 loops=7)

209. 1.085 1.085 ↓ 51.0 51 7

Index Scan using idx_mptd_turmapratica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.42..8.45 rows=1 width=33) (actual time=0.015..0.155 rows=51 loops=7)

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

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

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
211. 4.998 4.998 ↑ 1.0 1 357

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

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
212. 3.570 3.570 ↑ 1.0 1 357

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_2 (cost=0.42..8.45 rows=1 width=49) (actual time=0.008..0.010 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))
213.          

SubPlan (for Nested Loop)

214. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.25..29.28 rows=1 width=4) (never executed)

215. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_8 (cost=25.25..29.28 rows=1 width=4) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_2.matricula)::text) AND (disciplina = historico_2.disciplina))
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula_2.gradecurricularatual) AND ((anohistorico)::text = (historico_2.anohistorico)::text) AND ((semestrehistorico)::text = (historico_2.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico_2.transferenciamatrizcurricularmatricula))
216. 0.000 0.000 ↓ 0.0 0

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

217. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = historico_2.disciplina)
219. 0.231 21.791 ↑ 1.0 1 77

Limit (cost=0.42..50.64 rows=1 width=4) (actual time=0.283..0.283 rows=1 loops=77)

220. 21.560 21.560 ↑ 1.0 1 77

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_9 (cost=0.42..50.64 rows=1 width=4) (actual time=0.280..0.280 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
221. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=74.42..78.46 rows=1 width=0) (never executed)

222. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.16..49.17 rows=1 width=25) (never executed)

  • Group Key: (his_10.matricula)::text, (his_10.anohistorico)::text, (his_10.semestrehistorico)::text, his_10.disciplina, his_10.transferenciamatrizcurricularmatricula
223. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (((matricula)::text = (historico_2.matricula)::text) AND (matrizcurricular = matricula_2.gradecurricularatual))
  • Filter: ((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia))
224. 0.000 0.000 ↓ 0.0 0

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

225. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_gc (cost=0.00..40.20 rows=2,104 width=0) (never executed)

  • Index Cond: (matrizcurricular = matricula_2.gradecurricularatual)
227. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico hist_2 (cost=25.25..29.28 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_2.matricula)::text) AND (disciplina = his_10.disciplina))
  • Filter: (historicoporequivalencia AND (historico_2.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_2.numeroagrupamentoequivalenciadisciplina) AND ((his_10.anohistorico)::text = (anohistorico)::text) AND ((his_10.semestrehistorico)::text = (semestrehistorico)::text) AND (his_10.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
228. 0.000 0.000 ↓ 0.0 0

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

229. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = his_10.disciplina)
231. 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..4.45 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
232. 1.890 1.890 ↑ 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.004..0.006 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))
233. 0.000 0.000 ↓ 0.0 0

Append (cost=238.26..956.47 rows=4 width=25) (never executed)

234. 0.000 0.000 ↓ 0.0 0

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

235. 0.000 0.000 ↓ 0.0 0

Unique (cost=238.26..238.29 rows=1 width=69) (never executed)

236. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 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
237. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 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))))
238. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

239. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

240. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_9 (cost=0.00..209.20 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))
241. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_8 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_9.codigo)
242. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

246. 0.000 0.000 ↓ 0.0 0

Unique (cost=238.26..238.29 rows=1 width=69) (never executed)

247. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 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
248. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 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))))
249. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

250. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

251. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_10 (cost=0.00..209.20 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))
252. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_9 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_10.codigo)
253. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

257. 0.000 0.000 ↓ 0.0 0

Unique (cost=239.89..239.92 rows=1 width=69) (never executed)

258. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 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
259. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..239.88 rows=1 width=69) (never executed)

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

Nested Loop (cost=5.01..238.25 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))))
261. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

262. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

263. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_11 (cost=0.00..209.20 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))
264. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_10 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_11.codigo)
265. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

269. 0.000 0.000 ↓ 0.0 0

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

270. 0.000 0.000 ↓ 0.0 0

Unique (cost=239.89..239.92 rows=1 width=69) (never executed)

271. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 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
272. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..239.88 rows=1 width=69) (never executed)

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

Nested Loop (cost=5.01..238.25 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))))
274. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

275. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

276. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_12 (cost=0.00..209.20 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))
277. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_11 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_12.codigo)
278. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

282. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
283. 0.021 0.189 ↓ 0.0 0 7

Subquery Scan on *SELECT* 4 (cost=240.26..1,120.51 rows=1 width=17) (actual time=0.027..0.027 rows=0 loops=7)

284. 0.014 0.168 ↓ 0.0 0 7

Nested Loop (cost=240.26..1,120.50 rows=1 width=155) (actual time=0.024..0.024 rows=0 loops=7)

285. 0.014 0.154 ↓ 0.0 0 7

Nested Loop (cost=239.97..1,116.18 rows=1 width=21) (actual time=0.022..0.022 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))
286. 0.014 0.140 ↓ 0.0 0 7

Nested Loop (cost=1.71..159.63 rows=1 width=17) (actual time=0.020..0.020 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)))
287. 0.014 0.126 ↓ 0.0 0 7

Nested Loop (cost=1.43..159.30 rows=1 width=21) (actual time=0.018..0.018 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))))
288. 0.014 0.112 ↓ 0.0 0 7

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

289. 0.021 0.098 ↓ 0.0 0 7

Nested Loop (cost=0.72..16.76 rows=1 width=45) (actual time=0.014..0.014 rows=0 loops=7)

290. 0.077 0.077 ↓ 0.0 0 7

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

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

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

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

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

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

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

SubPlan (for Nested Loop)

295. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.25..29.28 rows=1 width=4) (never executed)

296. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_12 (cost=25.25..29.28 rows=1 width=4) (never executed)

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

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

298. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = historico_3.disciplina)
300. 0.000 0.000 ↓ 0.0 0

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

301. 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..50.64 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))
302. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=74.42..78.46 rows=1 width=0) (never executed)

303. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.16..49.17 rows=1 width=25) (never executed)

  • Group Key: (his_14.matricula)::text, (his_14.anohistorico)::text, (his_14.semestrehistorico)::text, his_14.disciplina, his_14.transferenciamatrizcurricularmatricula
304. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (((matricula)::text = (historico_3.matricula)::text) AND (matrizcurricular = matricula_3.gradecurricularatual))
  • Filter: ((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia))
305. 0.000 0.000 ↓ 0.0 0

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

306. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_gc (cost=0.00..40.20 rows=2,104 width=0) (never executed)

  • Index Cond: (matrizcurricular = matricula_3.gradecurricularatual)
308. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico hist_3 (cost=25.25..29.28 rows=1 width=25) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_3.matricula)::text) AND (disciplina = his_14.disciplina))
  • Filter: (historicoporequivalencia AND (historico_3.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_3.numeroagrupamentoequivalenciadisciplina) AND ((his_14.anohistorico)::text = (anohistorico)::text) AND ((his_14.semestrehistorico)::text = (semestrehistorico)::text) AND (his_14.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
309. 0.000 0.000 ↓ 0.0 0

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

310. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = his_14.disciplina)
312. 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..4.45 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
313. 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))
314. 0.000 0.000 ↓ 0.0 0

Append (cost=238.26..956.47 rows=4 width=25) (never executed)

315. 0.000 0.000 ↓ 0.0 0

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

316. 0.000 0.000 ↓ 0.0 0

Unique (cost=238.26..238.29 rows=1 width=69) (never executed)

317. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 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
318. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 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))))
319. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

320. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

321. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_13 (cost=0.00..209.20 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))
322. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_12 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_13.codigo)
323. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

327. 0.000 0.000 ↓ 0.0 0

Unique (cost=238.26..238.29 rows=1 width=69) (never executed)

328. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 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
329. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 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))))
330. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

331. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

332. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_14 (cost=0.00..209.20 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))
333. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_13 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_14.codigo)
334. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

338. 0.000 0.000 ↓ 0.0 0

Unique (cost=239.89..239.92 rows=1 width=69) (never executed)

339. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 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
340. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..239.88 rows=1 width=69) (never executed)

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

Nested Loop (cost=5.01..238.25 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))))
342. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

343. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

344. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_15 (cost=0.00..209.20 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))
345. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_14 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_15.codigo)
346. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

350. 0.000 0.000 ↓ 0.0 0

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

351. 0.000 0.000 ↓ 0.0 0

Unique (cost=239.89..239.92 rows=1 width=69) (never executed)

352. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 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
353. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..239.88 rows=1 width=69) (never executed)

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

Nested Loop (cost=5.01..238.25 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))))
355. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.59..223.66 rows=18 width=31) (never executed)

356. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.30..219.84 rows=1 width=27) (never executed)

357. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_16 (cost=0.00..209.20 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))
358. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturma horarioturma_15 (cost=4.30..10.62 rows=2 width=13) (never executed)

  • Recheck Cond: (turma = t_16.codigo)
359. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_horarioturma_turma_ano_semestre (cost=0.00..4.29 rows=2 width=0) (never executed)

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

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

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

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

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

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

363. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
364. 4.152 4.152 ↑ 7.0 2 519

Index Scan using ch_atividadediscursivarespostaaluno_atividadediscursiva on atividadediscursivarespostaaluno (cost=0.28..3.36 rows=14 width=41) (actual time=0.005..0.008 rows=2 loops=519)

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

SubPlan (for GroupAggregate)

366. 0.519 0.519 ↓ 0.0 0 519

Index Scan using idx_atividadediscursivainteracao_atividadediscursivarespostaalu on atividadediscursivainteracao (cost=0.28..8.30 rows=1 width=0) (actual time=0.001..0.001 rows=0 loops=519)

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

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

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