explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nMdv

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 4,155.915 ↑ 1.0 1 1

Aggregate (cost=47,697.96..47,697.97 rows=1 width=32) (actual time=4,155.913..4,155.915 rows=1 loops=1)

2. 0.034 4,155.895 ↓ 7.0 7 1

Unique (cost=47,697.90..47,697.94 rows=1 width=556) (actual time=4,155.857..4,155.895 rows=7 loops=1)

3. 0.076 4,155.861 ↓ 7.0 7 1

Sort (cost=47,697.90..47,697.90 rows=1 width=556) (actual time=4,155.854..4,155.861 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.558 4,155.785 ↓ 7.0 7 1

GroupAggregate (cost=47,689.54..47,697.89 rows=1 width=556) (actual time=4,153.551..4,155.785 rows=7 loops=1)

  • Group Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
5. 3.188 4,153.707 ↓ 520.0 520 1

Sort (cost=47,689.54..47,689.54 rows=1 width=537) (actual time=4,153.240..4,153.707 rows=520 loops=1)

  • Sort Key: atividadediscursiva.codigo, turma.codigo, disciplina.codigo
  • Sort Method: quicksort Memory: 553kB
6. 3.263 4,150.519 ↓ 520.0 520 1

Nested Loop Left Join (cost=11,993.58..47,689.53 rows=1 width=537) (actual time=879.398..4,150.519 rows=520 loops=1)

  • Join Filter: (atividadediscursivarespostaaluno.matriculaperiodoturmadisciplina = "*SELECT* 1".matriculaperiodoturmadisciplina)
  • Rows Removed by Join Filter: 992
7. 6.247 4,143.096 ↓ 520.0 520 1

Nested Loop Left Join (cost=11,993.30..47,685.99 rows=1 width=504) (actual time=879.314..4,143.096 rows=520 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,295
8. 0.047 307.023 ↓ 7.0 7 1

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

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

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

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

Merge Join (cost=10,928.27..10,942.51 rows=1 width=463) (actual time=306.085..306.706 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.881 2.626 ↑ 1.0 477 1

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

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

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

13. 0.076 303.399 ↑ 66.0 10 1

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

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

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

15. 0.382 303.299 ↑ 66.0 10 1

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

16. 1.362 302.917 ↑ 2.1 315 1

Sort (cost=10,806.86..10,808.51 rows=660 width=69) (actual time=302.668..302.917 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.101 301.555 ↑ 2.1 315 1

Hash Join (cost=7,250.27..10,775.95 rows=660 width=69) (actual time=190.546..301.555 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.248 274.209 ↑ 1.1 6,490 1

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

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

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

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

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

21. 8.678 22.030 ↑ 1.1 6,490 1

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

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

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

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

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

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

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

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

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

26. 7.973 18.245 ↓ 1.3 5,856 1

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

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

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

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

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

  • Index Cond: (codigo = horarioprofessor.disciplina)
29. 0.105 0.105 ↑ 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.015 rows=1 loops=7)

  • Index Cond: (codigo = horarioprofessor.turma)
30. 7.791 3,829.826 ↓ 136.2 545 7

Append (cost=1,064.47..36,741.66 rows=4 width=17) (actual time=323.860..547.118 rows=545 loops=7)

31. 0.014 1,072.162 ↓ 0.0 0 7

Subquery Scan on *SELECT* 1 (cost=1,064.47..18,106.54 rows=1 width=17) (actual time=153.166..153.166 rows=0 loops=7)

32. 0.014 1,072.148 ↓ 0.0 0 7

Nested Loop (cost=1,064.47..18,106.53 rows=1 width=155) (actual time=153.164..153.164 rows=0 loops=7)

33. 4.144 1,072.134 ↓ 0.0 0 7

Nested Loop (cost=1,064.17..18,102.21 rows=1 width=21) (actual time=153.162..153.162 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.572 1,061.606 ↓ 152.0 152 7

Nested Loop (cost=1,063.90..18,101.88 rows=1 width=25) (actual time=2.075..151.658 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.221 1,045.114 ↓ 156.0 156 7

Nested Loop (cost=1,063.47..17,960.93 rows=1 width=45) (actual time=2.046..149.302 rows=156 loops=7)

36. 4.459 1,022.329 ↓ 156.0 156 7

Nested Loop (cost=1,063.18..17,960.56 rows=1 width=49) (actual time=2.010..146.047 rows=156 loops=7)

37. 120.827 1,010.226 ↓ 156.0 156 7

Gather (cost=1,062.89..17,957.09 rows=1 width=37) (actual time=1.986..144.318 rows=156 loops=7)

  • Workers Planned: 2
  • Workers Launched: 2
38. 6.870 889.399 ↓ 52.0 52 21 / 3

Hash Join (cost=62.89..16,956.99 rows=1 width=37) (actual time=3.247..127.057 rows=52 loops=21)

  • Hash Cond: (matriculaperiodoturmadisciplina.programacaotutoriaonlineprofessor = horarioprofessor_1.codigoorigem)
39. 862.484 862.484 ↑ 1.2 650 21 / 3

Parallel Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..16,891.25 rows=757 width=37) (actual time=0.234..123.212 rows=650 loops=21)

  • Filter: (programacaotutoriaonlineprofessor IS NOT NULL)
  • Rows Removed by Filter: 198,893
40. 0.160 20.045 ↑ 1.0 13 15 / 3

Hash (cost=62.73..62.73 rows=13 width=8) (actual time=4.008..4.009 rows=13 loops=15)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
41. 0.160 19.885 ↑ 1.0 13 15 / 3

Subquery Scan on horarioprofessor_1 (cost=62.31..62.73 rows=13 width=8) (actual time=3.894..3.977 rows=13 loops=15)

42. 0.220 19.725 ↑ 1.0 13 15 / 3

Unique (cost=62.31..62.60 rows=13 width=92) (actual time=3.890..3.945 rows=13 loops=15)

43. 0.990 19.505 ↑ 1.0 13 15 / 3

Sort (cost=62.31..62.34 rows=13 width=92) (actual time=3.887..3.901 rows=13 loops=15)

  • 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
  • Worker 0: Sort Method: quicksort Memory: 26kB
  • Worker 1: Sort Method: quicksort Memory: 26kB
44. 0.380 18.515 ↑ 1.0 13 15 / 3

Nested Loop Left Join (cost=22.53..62.07 rows=13 width=92) (actual time=2.294..3.703 rows=13 loops=15)

45. 6.150 15.275 ↑ 1.0 13 15 / 3

Hash Join (cost=22.25..49.89 rows=13 width=44) (actual time=1.981..3.055 rows=13 loops=15)

  • Hash Cond: (programacaotutoriaonline.codigo = programacaotutoriaonlineprofessor.programacaotutoriaonline)
46. 6.905 6.905 ↑ 1.0 967 15 / 3

Seq Scan on programacaotutoriaonline (cost=0.00..22.67 rows=967 width=40) (actual time=0.099..1.381 rows=967 loops=15)

47. 0.190 2.220 ↑ 1.0 13 15 / 3

Hash (cost=22.09..22.09 rows=13 width=12) (actual time=0.442..0.444 rows=13 loops=15)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
48. 2.030 2.030 ↑ 1.0 13 15 / 3

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..22.09 rows=13 width=12) (actual time=0.250..0.406 rows=13 loops=15)

  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 954
49. 2.860 2.860 ↑ 1.0 1 195 / 3

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

  • Index Cond: (programacaotutoriaonline.turma = codigo)
50. 7.644 7.644 ↑ 1.0 1 1,092

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

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

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

  • Index Cond: ((matricula)::text = (matriculaperiodo.matricula)::text)
52. 10.920 10.920 ↑ 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.009..0.010 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))
53.          

SubPlan (for Nested Loop)

54. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

60. 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))
61. 0.000 0.000 ↓ 0.0 0

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

62. 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
63. 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))
64. 0.000 0.000 ↓ 0.0 0

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

65. 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)
66. 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)
67. 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))
68. 0.000 0.000 ↓ 0.0 0

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

69. 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)
70. 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)
71. 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
72. 6.384 6.384 ↑ 1.0 1 1,064

Index Scan using curso_pkey on curso (cost=0.28..0.30 rows=1 width=6) (actual time=0.005..0.006 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))
73. 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
74. 7.987 2,707.481 ↓ 545.0 545 7

Subquery Scan on *SELECT* 2 (cost=7,825.83..16,394.08 rows=1 width=17) (actual time=170.688..386.783 rows=545 loops=7)

75. 16.940 2,699.494 ↓ 545.0 545 7

Nested Loop (cost=7,825.83..16,394.07 rows=1 width=155) (actual time=170.685..385.642 rows=545 loops=7)

76. 15.400 2,663.479 ↓ 545.0 545 7

Nested Loop (cost=7,825.53..16,389.75 rows=1 width=21) (actual time=170.665..380.497 rows=545 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)))
77. 18.200 2,629.004 ↓ 545.0 545 7

Nested Loop (cost=7,825.26..16,389.42 rows=1 width=25) (actual time=170.642..375.572 rows=545 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))))
78. 16.842 2,568.839 ↓ 545.0 545 7

Nested Loop (cost=7,824.83..16,255.01 rows=1 width=45) (actual time=170.607..366.977 rows=545 loops=7)

79. 16.261 2,490.957 ↓ 545.0 545 7

Nested Loop (cost=7,824.54..16,254.64 rows=1 width=49) (actual time=170.567..355.851 rows=545 loops=7)

80. 1,352.967 2,451.806 ↓ 545.0 545 7

Gather (cost=7,824.25..16,254.32 rows=1 width=37) (actual time=170.537..350.258 rows=545 loops=7)

  • Workers Planned: 2
  • Workers Launched: 2
81. 3.010 1,098.839 ↓ 182.0 182 21 / 3

Nested Loop (cost=6,824.25..15,254.22 rows=1 width=37) (actual time=135.574..156.977 rows=182 loops=21)

82. 0.112 1,081.584 ↑ 55.0 5 21 / 3

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

83. 0.042 482.785 ↑ 117.8 5 7 / 3

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

84. 0.294 482.743 ↑ 117.8 5 7 / 3

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

85. 0.812 482.449 ↑ 7.9 75 7 / 3

Sort (cost=10,796.97..10,798.44 rows=589 width=69) (actual time=206.685..206.764 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 1: Sort Method: quicksort Memory: 35kB
86. 12.179 481.637 ↑ 7.9 75 4 / 3

Hash Join (cost=7,244.18..10,769.87 rows=589 width=69) (actual time=229.387..361.228 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
87. 20.684 447.072 ↑ 1.1 6,490 4 / 3

Hash Join (cost=6,999.07..10,506.72 rows=6,871 width=25) (actual time=44.043..335.304 rows=6,490 loops=4)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
88. 191.796 414.417 ↑ 1.1 6,490 4 / 3

Hash Join (cost=6,907.25..10,396.84 rows=6,871 width=16) (actual time=34.994..310.813 rows=6,490 loops=4)

  • Hash Cond: (horarioturmadia_1.codigo = horarioturmadiaitem_1.horarioturmadia)
89. 176.792 176.792 ↑ 1.0 102,793 4 / 3

Seq Scan on horarioturmadia horarioturmadia_1 (cost=0.00..2,649.93 rows=102,793 width=8) (actual time=0.059..132.594 rows=102,793 loops=4)

90. 12.207 45.829 ↑ 1.1 6,490 4 / 3

Hash (cost=6,821.36..6,821.36 rows=6,871 width=16) (actual time=34.371..34.372 rows=6,490 loops=4)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
91. 31.947 33.623 ↑ 1.1 6,490 4 / 3

Bitmap Heap Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=129.67..6,821.36 rows=6,871 width=16) (actual time=1.534..25.217 rows=6,490 loops=4)

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

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..127.95 rows=6,871 width=0) (actual time=1.256..1.257 rows=6,490 loops=4)

  • Index Cond: (professor = 9,959)
93. 5.780 11.971 ↑ 1.0 2,970 4 / 3

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=8.977..8.978 rows=2,970 loops=4)

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

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

95. 7.655 22.387 ↑ 1.0 3,888 4 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 207kB
96. 14.732 14.732 ↑ 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.233..11.049 rows=3,888 loops=4)

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

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

98. 1.808 548.329 ↑ 5.8 10 7 / 3

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

99. 2.500 546.520 ↓ 8.3 480 7 / 3

Sort (cost=6,823.83..6,823.97 rows=58 width=69) (actual time=233.732..234.223 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
100. 108.063 544.020 ↓ 8.3 480 2 / 3

Nested Loop (cost=266.41..6,822.13 rows=58 width=69) (actual time=323.397..816.030 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
101. 94.476 190.321 ↓ 8.8 61,409 2 / 3

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

102. 9.558 24.609 ↓ 24.0 4,857 2 / 3

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

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

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

104. 0.657 10.789 ↓ 2.6 607 2 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
105. 3.029 10.131 ↓ 2.6 607 2 / 3

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

  • Hash Cond: (horarioturma_2.turma = t_3.codigo)
106. 2.384 2.384 ↑ 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.062..3.576 rows=2,970 loops=2)

107. 0.676 4.718 ↓ 1.4 630 2 / 3

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

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

Seq Scan on turma t_3 (cost=0.00..194.56 rows=458 width=14) (actual time=0.081..6.063 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
109. 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)
110. 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
111. 0.005 24.570 ↓ 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.530..10.530 rows=0 loops=7)

112. 0.005 24.565 ↓ 0.0 0 7 / 3

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

113. 0.025 24.561 ↓ 0.0 0 7 / 3

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

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

  • Join Filter: (t_4.codigo = turmaagrupada_1.turmaorigem)
115. 2.492 24.534 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,177.86 rows=6 width=37) (actual time=73.602..73.603 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
116. 5.335 17.716 ↓ 7.6 4,508 1 / 3

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

117. 3.185 6.371 ↓ 7.6 4,508 1 / 3

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

118. 0.022 0.022 ↑ 1.0 28 1 / 3

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

119. 3.164 3.164 ↓ 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.339 rows=161 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente.disciplina) AND (professor = 9,959))
120. 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)
121. 0.289 4.326 ↓ 2.6 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
122. 1.421 4.037 ↓ 2.6 607 1 / 3

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

  • Hash Cond: (horarioturma_3.turma = t_4.codigo)
123. 1.016 1.016 ↑ 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.009..3.049 rows=2,970 loops=1)

124. 0.285 1.600 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_4 (cost=0.00..194.56 rows=458 width=14) (actual time=0.033..3.947 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
126. 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)
127. 0.005 22.360 ↓ 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.583..9.583 rows=0 loops=7)

128. 0.005 22.356 ↓ 0.0 0 7 / 3

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

129. 0.017 22.351 ↓ 0.0 0 7 / 3

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

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

  • Join Filter: (t_5.codigo = turmaagrupada_2.turmaorigem)
131. 2.071 22.333 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,045.37 rows=5 width=37) (actual time=66.999..67.000 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
132. 5.320 16.288 ↓ 7.7 3,839 1 / 3

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

133. 2.707 5.849 ↓ 7.7 3,839 1 / 3

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

134. 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.011..0.046 rows=28 loops=1)

135. 3.127 3.127 ↓ 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.009..0.335 rows=137 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente_1.equivalente) AND (professor = 9,959))
136. 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)
137. 0.257 3.974 ↓ 2.6 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
138. 1.265 3.717 ↓ 2.6 607 1 / 3

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

  • Hash Cond: (horarioturma_4.turma = t_5.codigo)
139. 0.933 0.933 ↑ 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.007..2.800 rows=2,970 loops=1)

140. 0.263 1.518 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_5 (cost=0.00..194.56 rows=458 width=14) (actual time=0.023..3.765 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
142. 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)
143. 0.005 1.010 ↓ 0.0 0 7 / 3

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

144. 0.005 1.006 ↓ 0.0 0 7 / 3

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

145. 0.018 1.001 ↓ 0.0 0 7 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=0.429..0.429 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
146. 0.001 0.983 ↓ 0.0 0 1 / 3

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

147. 0.001 0.982 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=2.945..2.946 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))))
148. 0.001 0.981 ↓ 0.0 0 1 / 3

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

149. 0.013 0.981 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_5.turma = t_6.codigo)
150. 0.005 0.005 ↑ 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.014..0.015 rows=1 loops=1)

151. 0.001 0.963 ↓ 0.0 0 1 / 3

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

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

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
153. 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)
154. 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)
155. 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)
156. 0.005 1.073 ↓ 0.0 0 7 / 3

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

157. 0.005 1.069 ↓ 0.0 0 7 / 3

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

158. 0.026 1.064 ↓ 0.0 0 7 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=0.456..0.456 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
159. 0.001 1.038 ↓ 0.0 0 1 / 3

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

160. 0.001 1.037 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=3.111..3.112 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))))
161. 0.001 1.036 ↓ 0.0 0 1 / 3

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

162. 0.016 1.036 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_6.turma = t_7.codigo)
163. 0.005 0.005 ↑ 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.013..0.014 rows=1 loops=1)

164. 0.001 1.015 ↓ 0.0 0 1 / 3

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

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

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
166. 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)
167. 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)
168. 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
169. 0.005 1.276 ↓ 0.0 0 7 / 3

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

170. 0.005 1.272 ↓ 0.0 0 7 / 3

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

171. 0.027 1.267 ↓ 0.0 0 7 / 3

Sort (cost=727.44..727.45 rows=4 width=69) (actual time=0.542..0.543 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
172. 0.001 1.240 ↓ 0.0 0 1 / 3

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

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

174. 0.026 1.238 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_7.turma = t_8.codigo)
175. 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.020..0.020 rows=1 loops=1)

176. 0.001 1.206 ↓ 0.0 0 1 / 3

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

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

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
178. 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)
179. 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)
180. 14.245 14.245 ↓ 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.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
181. 22.890 22.890 ↑ 1.0 1 3,815

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,815)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
182. 61.040 61.040 ↑ 1.0 1 3,815

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,815)

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
183. 41.965 41.965 ↑ 1.0 1 3,815

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,815)

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

SubPlan (for Nested Loop)

185. 0.000 0.000 ↓ 0.0 0

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

186. 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))
187. 0.000 0.000 ↓ 0.0 0

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

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

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

191. 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))
192. 0.000 0.000 ↓ 0.0 0

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

193. 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
194. 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))
195. 0.000 0.000 ↓ 0.0 0

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

196. 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)
197. 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)
198. 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))
199. 0.000 0.000 ↓ 0.0 0

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

200. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (historico_1.matricula)::text)
201. 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)
202. 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
203. 19.075 19.075 ↑ 1.0 1 3,815

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

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

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,815)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
205. 0.028 42.189 ↓ 0.0 0 7

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

206. 0.014 42.161 ↓ 0.0 0 7

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

207. 0.014 42.147 ↓ 0.0 0 7

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

Nested Loop (cost=1.71..159.63 rows=1 width=17) (actual time=6.019..6.019 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
209. 2.044 39.102 ↓ 45.0 45 7

Nested Loop (cost=1.43..159.30 rows=1 width=21) (actual time=0.095..5.586 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
210. 1.267 11.389 ↓ 51.0 51 7

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

211. 1.435 4.767 ↓ 51.0 51 7

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

212. 1.190 1.190 ↓ 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.020..0.170 rows=51 loops=7)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
213. 2.142 2.142 ↑ 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.006..0.006 rows=1 loops=357)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
214. 5.355 5.355 ↑ 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.015..0.015 rows=1 loops=357)

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
215. 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.009..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))
216.          

SubPlan (for Nested Loop)

217. 0.000 0.000 ↓ 0.0 0

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

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

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

220. 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)
221. 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)
222. 0.231 22.099 ↑ 1.0 1 77

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

223. 21.868 21.868 ↑ 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.284..0.284 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
224. 0.000 0.000 ↓ 0.0 0

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

225. 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
226. 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))
227. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

237. 0.000 0.000 ↓ 0.0 0

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

238. 0.000 0.000 ↓ 0.0 0

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

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

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

242. 0.000 0.000 ↓ 0.0 0

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

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

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

249. 0.000 0.000 ↓ 0.0 0

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

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

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

253. 0.000 0.000 ↓ 0.0 0

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

254. 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))
255. 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)
256. 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)
257. 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)
258. 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)
259. 0.000 0.000 ↓ 0.0 0

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

260. 0.000 0.000 ↓ 0.0 0

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

261. 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
262. 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)
263. 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))))
264. 0.000 0.000 ↓ 0.0 0

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

265. 0.000 0.000 ↓ 0.0 0

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

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

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

272. 0.000 0.000 ↓ 0.0 0

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

273. 0.000 0.000 ↓ 0.0 0

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

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

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

278. 0.000 0.000 ↓ 0.0 0

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

279. 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))
280. 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)
281. 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)
282. 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)
283. 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)
284. 0.000 0.000 ↓ 0.0 0

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

285. 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
286. 0.021 0.203 ↓ 0.0 0 7

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

287. 0.014 0.182 ↓ 0.0 0 7

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

288. 0.021 0.168 ↓ 0.0 0 7

Nested Loop (cost=239.97..1,116.18 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))
289. 0.014 0.147 ↓ 0.0 0 7

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

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

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

292. 0.014 0.105 ↓ 0.0 0 7

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

293. 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=33) (actual time=0.013..0.013 rows=0 loops=7)

  • Index Cond: ((turmateorica IS NOT NULL) AND (turmateorica IS NOT NULL))
294. 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)
295. 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)
296. 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))
297.          

SubPlan (for Nested Loop)

298. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

306. 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
307. 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))
308. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

318. 0.000 0.000 ↓ 0.0 0

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

319. 0.000 0.000 ↓ 0.0 0

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

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

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

323. 0.000 0.000 ↓ 0.0 0

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

324. 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))
325. 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)
326. 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)
327. 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)
328. 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)
329. 0.000 0.000 ↓ 0.0 0

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

330. 0.000 0.000 ↓ 0.0 0

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

331. 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
332. 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))))
333. 0.000 0.000 ↓ 0.0 0

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

334. 0.000 0.000 ↓ 0.0 0

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

335. 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))
336. 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)
337. 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)
338. 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)
339. 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)
340. 0.000 0.000 ↓ 0.0 0

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

341. 0.000 0.000 ↓ 0.0 0

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

342. 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
343. 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)
344. 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))))
345. 0.000 0.000 ↓ 0.0 0

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

346. 0.000 0.000 ↓ 0.0 0

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

347. 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))
348. 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)
349. 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)
350. 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)
351. 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)
352. 0.000 0.000 ↓ 0.0 0

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

353. 0.000 0.000 ↓ 0.0 0

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

354. 0.000 0.000 ↓ 0.0 0

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

355. 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
356. 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)
357. 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))))
358. 0.000 0.000 ↓ 0.0 0

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

359. 0.000 0.000 ↓ 0.0 0

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

360. 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))
361. 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)
362. 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)
363. 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)
364. 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)
365. 0.000 0.000 ↓ 0.0 0

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

366. 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
367. 4.160 4.160 ↑ 7.0 2 520

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=520)

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

SubPlan (for GroupAggregate)

369. 0.520 0.520 ↓ 0.0 0 520

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=520)

  • Index Cond: (atividadediscursivarespostaaluno = atividadediscursivarespostaaluno.codigo)
  • Filter: ((NOT interacaojalida) AND ((interagidopor)::text = 'ALUNO'::text))
  • Rows Removed by Filter: 0
370. 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 : 140.625 ms
Execution time : 4,166.830 ms