explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 88pG

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 2,994.284 ↑ 1.0 1 1

Aggregate (cost=29,385.73..29,385.74 rows=1 width=32) (actual time=2,994.282..2,994.284 rows=1 loops=1)

2. 0.027 2,994.264 ↓ 7.0 7 1

Unique (cost=29,385.67..29,385.72 rows=1 width=556) (actual time=2,994.234..2,994.264 rows=7 loops=1)

3. 0.066 2,994.237 ↓ 7.0 7 1

Sort (cost=29,385.67..29,385.68 rows=1 width=556) (actual time=2,994.230..2,994.237 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.538 2,994.171 ↓ 7.0 7 1

GroupAggregate (cost=29,377.31..29,385.66 rows=1 width=556) (actual time=2,991.969..2,994.171 rows=7 loops=1)

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

Sort (cost=29,377.31..29,377.32 rows=1 width=537) (actual time=2,991.618..2,992.114 rows=519 loops=1)

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

Nested Loop Left Join (cost=10,864.35..29,377.30 rows=1 width=537) (actual time=719.631..2,988.884 rows=519 loops=1)

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

Nested Loop Left Join (cost=10,864.07..29,373.75 rows=1 width=504) (actual time=719.569..2,981.633 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.051 298.814 ↓ 7.0 7 1

Nested Loop (cost=10,799.76..10,814.44 rows=1 width=518) (actual time=297.973..298.814 rows=7 loops=1)

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

Nested Loop (cost=10,799.48..10,813.09 rows=1 width=493) (actual time=297.942..298.672 rows=7 loops=1)

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

Merge Join (cost=10,799.20..10,812.60 rows=1 width=463) (actual time=297.880..298.484 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.974 2.709 ↑ 1.0 477 1

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

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

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

13. 0.061 295.075 ↑ 59.3 10 1

Sort (cost=10,730.15..10,731.63 rows=593 width=13) (actual time=295.055..295.075 rows=10 loops=1)

  • Sort Key: horarioprofessor.turma, horarioprofessor.disciplina, horarioprofessor.ano, horarioprofessor.semestre
  • Sort Method: quicksort Memory: 25kB
14. 0.026 295.014 ↑ 59.3 10 1

Subquery Scan on horarioprofessor (cost=10,683.56..10,702.84 rows=593 width=13) (actual time=294.263..295.014 rows=10 loops=1)

15. 0.451 294.988 ↑ 59.3 10 1

Unique (cost=10,683.56..10,696.91 rows=593 width=69) (actual time=294.257..294.988 rows=10 loops=1)

16. 1.408 294.537 ↑ 1.9 315 1

Sort (cost=10,683.56..10,685.05 rows=593 width=69) (actual time=294.253..294.537 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. 8.641 293.129 ↑ 1.9 315 1

Hash Join (cost=7,140.45..10,656.25 rows=593 width=69) (actual time=182.452..293.129 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.093 266.093 ↓ 1.0 6,490 1

Hash Join (cost=6,889.26..10,388.78 rows=6,201 width=25) (actual time=26.785..266.093 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
19. 124.889 244.974 ↓ 1.0 6,490 1

Hash Join (cost=6,797.43..10,280.65 rows=6,201 width=16) (actual time=19.689..244.974 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.codigo = horarioturmadiaitem.horarioturmadia)
20. 100.840 100.840 ↑ 1.0 102,792 1

Seq Scan on horarioturmadia (cost=0.00..2,650.12 rows=102,812 width=8) (actual time=0.010..100.840 rows=102,792 loops=1)

21. 7.669 19.245 ↓ 1.0 6,490 1

Hash (cost=6,719.92..6,719.92 rows=6,201 width=16) (actual time=19.244..19.245 rows=6,490 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
22. 10.746 11.576 ↓ 1.0 6,490 1

Bitmap Heap Scan on horarioturmadiaitem (cost=120.48..6,719.92 rows=6,201 width=16) (actual time=1.065..11.576 rows=6,490 loops=1)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,217
23. 0.830 0.830 ↓ 1.0 6,490 1

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..118.93 rows=6,201 width=0) (actual time=0.829..0.830 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
24. 3.545 7.026 ↑ 1.0 2,969 1

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=7.025..7.026 rows=2,969 loops=1)

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

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

26. 7.750 18.395 ↓ 1.3 5,856 1

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

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

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

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

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

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

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

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

Append (cost=64.31..18,559.20 rows=4 width=17) (actual time=183.153..382.415 rows=544 loops=7)

31. 0.014 59.381 ↓ 0.0 0 7

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

32. 0.014 59.367 ↓ 0.0 0 7

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

33. 3.521 59.353 ↓ 0.0 0 7

Nested Loop (cost=64.01..315.76 rows=1 width=21) (actual time=8.479..8.479 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. 5.187 50.512 ↓ 152.0 152 7

Nested Loop (cost=63.74..315.43 rows=1 width=25) (actual time=0.523..7.216 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. 3.696 36.589 ↓ 156.0 156 7

Nested Loop (cost=63.31..176.85 rows=1 width=33) (actual time=0.501..5.227 rows=156 loops=7)

36. 3.549 17.605 ↓ 156.0 156 7

Nested Loop (cost=63.02..176.48 rows=1 width=37) (actual time=0.472..2.515 rows=156 loops=7)

37. 2.562 8.596 ↓ 156.0 156 7

Nested Loop (cost=62.73..172.64 rows=1 width=25) (actual time=0.454..1.228 rows=156 loops=7)

38. 0.266 2.758 ↑ 1.0 13 7

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

39. 0.189 2.492 ↑ 1.0 13 7

Sort (cost=62.31..62.34 rows=13 width=92) (actual time=0.340..0.356 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.049 2.303 ↑ 1.0 13 1

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

41. 1.058 2.163 ↑ 1.0 13 1

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

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

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

43. 0.026 0.186 ↑ 1.0 13 1

Hash (cost=22.09..22.09 rows=13 width=12) (actual time=0.185..0.186 rows=13 loops=1)

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

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

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

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

Index Scan using idx_mptd_programacaotutoriaonlineprofessor on matriculaperiodoturmadisciplina (cost=0.42..8.45 rows=1 width=25) (actual time=0.005..0.036 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.84 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. 8.736 8.736 ↑ 1.0 1 1,092

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.42..7.43 rows=1 width=49) (actual time=0.007..0.008 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=25.10..29.12 rows=1 width=4) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his (cost=25.10..29.12 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.10..25.10 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.16 rows=1,032 width=0) (never executed)

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

Limit (cost=0.42..46.43 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..46.43 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.10..78.15 rows=1 width=0) (never executed)

59. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.01..49.02 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=44.98..48.99 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=44.98..44.98 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.05 rows=2,083 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.10..29.12 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.10..25.10 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.16 rows=1,032 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.749 2,562.182 ↓ 544.0 544 7

Subquery Scan on *SELECT* 2 (cost=7,826.84..16,003.24 rows=1 width=17) (actual time=174.666..366.026 rows=544 loops=7)

72. 15.267 2,554.433 ↓ 544.0 544 7

Nested Loop (cost=7,826.84..16,003.23 rows=1 width=155) (actual time=174.663..364.919 rows=544 loops=7)

73. 17.563 2,520.126 ↓ 544.0 544 7

Nested Loop (cost=7,826.55..15,998.91 rows=1 width=21) (actual time=174.647..360.018 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.500 2,487.331 ↓ 544.0 544 7

Nested Loop (cost=7,826.27..15,998.58 rows=1 width=25) (actual time=174.625..355.333 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. 17.024 2,431.751 ↓ 544.0 544 7

Nested Loop (cost=7,825.85..15,866.74 rows=1 width=33) (actual time=174.597..347.393 rows=544 loops=7)

76. 13.958 2,357.607 ↓ 544.0 544 7

Nested Loop (cost=7,825.56..15,866.38 rows=1 width=37) (actual time=174.564..336.801 rows=544 loops=7)

77. 1,279.698 2,320.801 ↓ 544.0 544 7

Gather (cost=7,825.27..15,866.05 rows=1 width=25) (actual time=174.537..331.543 rows=544 loops=7)

  • Workers Planned: 2
  • Workers Launched: 2
78. 2.828 1,041.103 ↓ 181.0 181 21 / 3

Nested Loop (cost=6,825.27..14,865.95 rows=1 width=25) (actual time=132.612..148.729 rows=181 loops=21)

79. 0.110 1,024.030 ↑ 49.6 5 21 / 3

Parallel Append (cost=6,824.84..12,876.24 rows=248 width=25) (actual time=132.541..146.290 rows=5 loops=21)

80. 0.037 435.015 ↑ 105.8 5 7 / 3

Subquery Scan on *SELECT* 1_1 (cost=10,674.09..10,691.29 rows=529 width=25) (actual time=186.227..186.435 rows=5 loops=7)

81. 0.289 434.978 ↑ 105.8 5 7 / 3

Unique (cost=10,674.09..10,686.00 rows=529 width=69) (actual time=186.222..186.419 rows=5 loops=7)

82. 0.712 434.688 ↑ 7.1 75 7 / 3

Sort (cost=10,674.09..10,675.42 rows=529 width=69) (actual time=186.218..186.295 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. 10.725 433.976 ↑ 7.1 75 4 / 3

Hash Join (cost=7,134.37..10,650.16 rows=529 width=69) (actual time=205.660..325.482 rows=75 loops=4)

  • 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. 18.872 402.659 ↓ 1.0 6,490 4 / 3

Hash Join (cost=6,889.26..10,388.78 rows=6,201 width=25) (actual time=38.223..301.994 rows=6,490 loops=4)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
85. 171.287 373.471 ↓ 1.0 6,490 4 / 3

Hash Join (cost=6,797.43..10,280.65 rows=6,201 width=16) (actual time=30.412..280.103 rows=6,490 loops=4)

  • Hash Cond: (horarioturmadia_1.codigo = horarioturmadiaitem_1.horarioturmadia)
86. 162.309 162.309 ↑ 1.0 102,792 4 / 3

Seq Scan on horarioturmadia horarioturmadia_1 (cost=0.00..2,650.12 rows=102,812 width=8) (actual time=0.040..121.732 rows=102,792 loops=4)

87. 11.041 39.875 ↓ 1.0 6,490 4 / 3

Hash (cost=6,719.92..6,719.92 rows=6,201 width=16) (actual time=29.905..29.906 rows=6,490 loops=4)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
88. 27.375 28.833 ↓ 1.0 6,490 4 / 3

Bitmap Heap Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=120.48..6,719.92 rows=6,201 width=16) (actual time=1.373..21.625 rows=6,490 loops=4)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,217
89. 1.459 1.459 ↓ 1.0 6,490 4 / 3

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..118.93 rows=6,201 width=0) (actual time=1.093..1.094 rows=6,490 loops=4)

  • Index Cond: (professor = 9,959)
90. 4.859 10.316 ↑ 1.0 2,969 4 / 3

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=7.736..7.737 rows=2,969 loops=4)

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

Seq Scan on horarioturma horarioturma_1 (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.078..4.093 rows=2,969 loops=4)

92. 7.151 20.592 ↑ 1.0 3,888 4 / 3

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

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

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

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

Subquery Scan on *SELECT* 2_1 (cost=6,824.84..6,826.66 rows=52 width=25) (actual time=229.012..230.248 rows=10 loops=7)

95. 1.680 537.182 ↑ 5.2 10 7 / 3

Unique (cost=6,824.84..6,826.14 rows=52 width=69) (actual time=229.008..230.221 rows=10 loops=7)

96. 2.417 535.502 ↓ 9.2 480 7 / 3

Sort (cost=6,824.84..6,824.97 rows=52 width=69) (actual time=229.005..229.501 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. 101.182 533.085 ↓ 9.2 480 2 / 3

Nested Loop (cost=266.41..6,823.36 rows=52 width=69) (actual time=326.973..799.628 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. 91.745 186.427 ↓ 8.8 61,369 2 / 3

Nested Loop (cost=265.98..1,138.47 rows=7,011 width=31) (actual time=15.575..279.641 rows=61,369 loops=2)

99. 9.217 23.475 ↓ 24.0 4,855 2 / 3

Hash Join (cost=265.69..367.92 rows=202 width=27) (actual time=15.463..35.213 rows=4,855 loops=2)

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

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

101. 0.615 10.164 ↓ 2.6 606 2 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=15.245..15.246 rows=606 loops=2)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
102. 2.915 9.549 ↓ 2.6 606 2 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=6.650..14.323 rows=606 loops=2)

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

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

104. 0.591 4.325 ↓ 1.4 630 2 / 3

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

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

Seq Scan on turma t_3 (cost=0.00..194.56 rows=458 width=14) (actual time=0.059..5.601 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.207 71.207 ↑ 2.9 13 9,710 / 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,710)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
107. 245.476 245.476 ↓ 0.0 0 122,738 / 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,738)

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

Subquery Scan on *SELECT* 3_1 (cost=3,032.17..3,032.32 rows=4 width=25) (actual time=11.182..11.182 rows=0 loops=7)

109. 0.005 26.087 ↓ 0.0 0 7 / 3

Unique (cost=3,032.17..3,032.28 rows=4 width=69) (actual time=11.179..11.180 rows=0 loops=7)

110. 0.020 26.082 ↓ 0.0 0 7 / 3

Sort (cost=3,032.17..3,032.18 rows=4 width=69) (actual time=11.178..11.178 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 26.062 ↓ 0.0 0 1 / 3

Nested Loop (cost=266.69..3,032.13 rows=4 width=69) (actual time=78.187..78.187 rows=0 loops=1)

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

Hash Join (cost=266.41..3,029.21 rows=5 width=37) (actual time=78.183..78.184 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. 6.056 18.713 ↓ 8.7 4,508 1 / 3

Nested Loop (cost=0.71..2,760.58 rows=516 width=20) (actual time=0.118..56.140 rows=4,508 loops=1)

114. 3.195 6.647 ↓ 8.7 4,508 1 / 3

Nested Loop (cost=0.42..1,966.55 rows=516 width=20) (actual time=0.083..19.940 rows=4,508 loops=1)

115. 0.017 0.017 ↑ 1.0 28 1 / 3

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

116. 3.435 3.435 ↓ 9.5 161 28 / 3

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_3 (cost=0.42..70.02 rows=17 width=16) (actual time=0.010..0.368 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.54 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=4,508)

  • Index Cond: (codigo = horarioturmadiaitem_3.horarioturmadia)
118. 0.328 4.705 ↓ 2.6 606 1 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=14.115..14.116 rows=606 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
119. 1.495 4.377 ↓ 2.6 606 1 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=5.524..13.132 rows=606 loops=1)

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

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

121. 0.323 1.802 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_4 (cost=0.00..194.56 rows=458 width=14) (actual time=0.030..4.435 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 22.297 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 4_1 (cost=2,953.40..2,953.55 rows=4 width=25) (actual time=9.556..9.556 rows=0 loops=7)

125. 0.005 22.293 ↓ 0.0 0 7 / 3

Unique (cost=2,953.40..2,953.51 rows=4 width=69) (actual time=9.554..9.554 rows=0 loops=7)

126. 0.015 22.288 ↓ 0.0 0 7 / 3

Sort (cost=2,953.40..2,953.41 rows=4 width=69) (actual time=9.552..9.552 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 22.273 ↓ 0.0 0 1 / 3

Nested Loop (cost=266.69..2,953.36 rows=4 width=69) (actual time=66.819..66.820 rows=0 loops=1)

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

Hash Join (cost=266.41..2,950.44 rows=5 width=37) (actual time=66.816..66.818 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. 5.138 16.081 ↓ 8.3 3,839 1 / 3

Nested Loop (cost=0.71..2,682.10 rows=465 width=20) (actual time=0.135..48.243 rows=3,839 loops=1)

130. 2.683 5.825 ↓ 8.3 3,839 1 / 3

Nested Loop (cost=0.42..1,966.55 rows=465 width=20) (actual time=0.104..17.474 rows=3,839 loops=1)

131. 0.015 0.015 ↑ 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.046 rows=28 loops=1)

132. 3.127 3.127 ↓ 8.1 137 28 / 3

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_4 (cost=0.42..70.02 rows=17 width=16) (actual time=0.009..0.335 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.54 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=3,839)

  • Index Cond: (codigo = horarioturmadiaitem_4.horarioturmadia)
134. 0.297 4.146 ↓ 2.6 606 1 / 3

Hash (cost=262.79..262.79 rows=232 width=27) (actual time=12.437..12.438 rows=606 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
135. 1.354 3.849 ↓ 2.6 606 1 / 3

Hash Join (cost=200.28..262.79 rows=232 width=27) (actual time=4.649..11.547 rows=606 loops=1)

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

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

137. 0.286 1.514 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_5 (cost=0.00..194.56 rows=458 width=14) (actual time=0.037..3.682 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.036 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 7 (cost=728.05..728.09 rows=1 width=25) (actual time=0.444..0.444 rows=0 loops=7)

141. 0.005 1.031 ↓ 0.0 0 7 / 3

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

142. 0.015 1.027 ↓ 0.0 0 7 / 3

Sort (cost=728.05..728.06 rows=1 width=69) (actual time=0.440..0.440 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.012 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.78..728.04 rows=1 width=69) (actual time=3.035..3.036 rows=0 loops=1)

144. 0.001 1.011 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.37 rows=4 width=33) (actual time=3.033..3.034 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.011 ↓ 0.0 0 1 / 3

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

146. 0.013 1.010 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_5.turma = t_6.codigo)
147. 0.003 0.003 ↑ 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.008..0.009 rows=1 loops=1)

148. 0.001 0.994 ↓ 0.0 0 1 / 3

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

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

Seq Scan on turma t_6 (cost=0.00..194.56 rows=29 width=14) (actual time=2.979..2.980 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.029 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 6 (cost=728.05..728.09 rows=1 width=25) (actual time=0.441..0.441 rows=0 loops=7)

154. 0.005 1.024 ↓ 0.0 0 7 / 3

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

155. 0.015 1.020 ↓ 0.0 0 7 / 3

Sort (cost=728.05..728.05 rows=1 width=69) (actual time=0.437..0.437 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.005 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.78..728.04 rows=1 width=69) (actual time=3.013..3.014 rows=0 loops=1)

157. 0.001 1.004 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.37 rows=4 width=33) (actual time=3.010..3.011 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.003 ↓ 0.0 0 1 / 3

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

159. 0.011 1.002 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_6.turma = t_7.codigo)
160. 0.003 0.003 ↑ 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.009..0.010 rows=1 loops=1)

161. 0.001 0.988 ↓ 0.0 0 1 / 3

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

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

Seq Scan on turma t_7 (cost=0.00..194.56 rows=29 width=14) (actual time=2.959..2.960 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.206 ↓ 0.0 0 7 / 3

Subquery Scan on *SELECT* 5 (cost=727.41..727.54 rows=4 width=25) (actual time=0.517..0.517 rows=0 loops=7)

167. 0.005 1.202 ↓ 0.0 0 7 / 3

Unique (cost=727.41..727.50 rows=4 width=69) (actual time=0.515..0.515 rows=0 loops=7)

168. 0.027 1.197 ↓ 0.0 0 7 / 3

Sort (cost=727.41..727.42 rows=4 width=69) (actual time=0.513..0.513 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.170 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.37 rows=4 width=69) (actual time=3.509..3.510 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.169 ↓ 0.0 0 1 / 3

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

171. 0.017 1.168 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_7.turma = t_8.codigo)
172. 0.007 0.007 ↑ 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.021..0.022 rows=1 loops=1)

173. 0.001 1.144 ↓ 0.0 0 1 / 3

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

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

Seq Scan on turma t_8 (cost=0.00..194.56 rows=29 width=14) (actual time=3.429..3.430 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. 14.245 14.245 ↓ 36.0 36 105 / 3

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.42..8.01 rows=1 width=21) (actual time=0.041..0.407 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. 57.120 57.120 ↑ 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.015..0.015 rows=1 loops=3,808)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
180. 38.080 38.080 ↑ 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.008..0.010 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)
181.          

SubPlan (for Nested Loop)

182. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.10..29.12 rows=1 width=4) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_4 (cost=25.10..29.12 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.10..25.10 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.16 rows=1,032 width=0) (never executed)

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

Limit (cost=0.42..46.43 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..46.43 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.10..78.15 rows=1 width=0) (never executed)

190. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.01..49.02 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=44.98..48.99 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=44.98..44.98 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.05 rows=2,083 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.10..29.12 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.10..25.10 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.16 rows=1,032 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.003..0.005 rows=1 loops=3,808)

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

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

203. 0.014 47.600 ↓ 0.0 0 7

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

204. 0.035 47.586 ↓ 0.0 0 7

Nested Loop (cost=239.97..1,113.60 rows=1 width=21) (actual time=6.798..6.798 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.449 47.551 ↓ 0.0 0 7

Nested Loop (cost=1.71..157.05 rows=1 width=17) (actual time=6.793..6.793 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. 2.317 43.897 ↓ 45.0 45 7

Nested Loop (cost=1.43..156.72 rows=1 width=21) (actual time=0.088..6.271 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.785 13.244 ↓ 51.0 51 7

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

208. 1.610 5.390 ↓ 51.0 51 7

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

209. 1.281 1.281 ↓ 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.183 rows=51 loops=7)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
210. 2.499 2.499 ↑ 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.007..0.007 rows=1 loops=357)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
211. 6.069 6.069 ↑ 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.017..0.017 rows=1 loops=357)

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
212. 3.927 3.927 ↑ 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.010..0.011 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.10..29.12 rows=1 width=4) (never executed)

215. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_8 (cost=25.10..29.12 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.10..25.10 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.16 rows=1,032 width=0) (never executed)

  • Index Cond: (disciplina = historico_2.disciplina)
219. 0.308 24.409 ↑ 1.0 1 77

Limit (cost=0.42..46.43 rows=1 width=4) (actual time=0.317..0.317 rows=1 loops=77)

220. 24.101 24.101 ↑ 1.0 1 77

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_9 (cost=0.42..46.43 rows=1 width=4) (actual time=0.313..0.313 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.10..78.15 rows=1 width=0) (never executed)

222. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.01..49.02 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=44.98..48.99 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=44.98..44.98 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.05 rows=2,083 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.10..29.12 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.10..25.10 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.16 rows=1,032 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. 2.205 2.205 ↑ 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.006..0.007 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.203 ↓ 0.0 0 7

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

284. 0.014 0.182 ↓ 0.0 0 7

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

285. 0.014 0.168 ↓ 0.0 0 7

Nested Loop (cost=239.97..1,113.60 rows=1 width=21) (actual time=0.024..0.024 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.154 ↓ 0.0 0 7

Nested Loop (cost=1.71..157.05 rows=1 width=17) (actual time=0.022..0.022 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.021 0.140 ↓ 0.0 0 7

Nested Loop (cost=1.43..156.72 rows=1 width=21) (actual time=0.020..0.020 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.119 ↓ 0.0 0 7

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

289. 0.014 0.105 ↓ 0.0 0 7

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

290. 0.091 0.091 ↓ 0.0 0 7

Index Scan using idx_mptd_turmateorica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.42..8.45 rows=1 width=21) (actual time=0.013..0.013 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.44 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)
294.          

SubPlan (for Nested Loop)

295. 0.000 0.000 ↓ 0.0 0

Limit (cost=25.10..29.12 rows=1 width=4) (never executed)

296. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_12 (cost=25.10..29.12 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.10..25.10 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.16 rows=1,032 width=0) (never executed)

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

Limit (cost=0.42..46.43 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..46.43 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.10..78.15 rows=1 width=0) (never executed)

303. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=49.01..49.02 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=44.98..48.99 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=44.98..44.98 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.05 rows=2,083 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.10..29.12 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.10..25.10 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.16 rows=1,032 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.37 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.24 rows=275 width=4) (never executed)

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