explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ss79

Settings
# exclusive inclusive rows x rows loops node
1. 1.039 1,080.661 ↓ 136.2 545 1

Append (cost=1,064.47..36,741.66 rows=4 width=49) (actual time=552.825..1,080.661 rows=545 loops=1)

2. 0.002 151.655 ↓ 0.0 0 1

Nested Loop (cost=1,064.47..18,106.53 rows=1 width=49) (actual time=151.655..151.655 rows=0 loops=1)

3. 0.614 151.653 ↓ 0.0 0 1

Nested Loop (cost=1,064.17..18,102.21 rows=1 width=45) (actual time=151.652..151.653 rows=0 loops=1)

  • 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
4. 0.892 150.127 ↓ 152.0 152 1

Nested Loop (cost=1,063.90..18,101.88 rows=1 width=49) (actual time=10.030..150.127 rows=152 loops=1)

  • 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 1))))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicocursandoporcorrespondenciaapostransferencia AND (historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 2) AND ((NOT historico.historicoporequivalencia) OR (historico.historicoporequivalencia IS NULL))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicoequivalente AND (SubPlan 3)) OR ((historico.matrizcurricular = matriculaperiodo.gradecurricular) AND (matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 4))))
  • Rows Removed by Join Filter: 4
5. 0.651 147.675 ↓ 156.0 156 1

Nested Loop (cost=1,063.47..17,960.93 rows=1 width=57) (actual time=9.984..147.675 rows=156 loops=1)

6. 0.229 144.372 ↓ 156.0 156 1

Nested Loop (cost=1,063.18..17,960.56 rows=1 width=61) (actual time=9.938..144.372 rows=156 loops=1)

7. 21.570 143.051 ↓ 156.0 156 1

Gather (cost=1,062.89..17,957.09 rows=1 width=45) (actual time=9.920..143.051 rows=156 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 1.007 121.481 ↓ 52.0 52 3 / 3

Hash Join (cost=62.89..16,956.99 rows=1 width=45) (actual time=3.646..121.481 rows=52 loops=3)

  • Hash Cond: (matriculaperiodoturmadisciplina.programacaotutoriaonlineprofessor = horarioprofessor.codigoorigem)
9. 117.242 117.242 ↑ 1.2 650 3 / 3

Parallel Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..16,891.25 rows=757 width=45) (actual time=0.253..117.242 rows=650 loops=3)

  • Filter: (programacaotutoriaonlineprofessor IS NOT NULL)
  • Rows Removed by Filter: 198,899
10. 0.027 3.232 ↑ 1.0 13 3 / 3

Hash (cost=62.73..62.73 rows=13 width=8) (actual time=3.231..3.232 rows=13 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
11. 0.029 3.205 ↑ 1.0 13 3 / 3

Subquery Scan on horarioprofessor (cost=62.31..62.73 rows=13 width=8) (actual time=3.132..3.205 rows=13 loops=3)

12. 0.038 3.176 ↑ 1.0 13 3 / 3

Unique (cost=62.31..62.60 rows=13 width=92) (actual time=3.128..3.176 rows=13 loops=3)

13. 0.147 3.138 ↑ 1.0 13 3 / 3

Sort (cost=62.31..62.34 rows=13 width=92) (actual time=3.126..3.138 rows=13 loops=3)

  • Sort Key: programacaotutoriaonlineprofessor.codigo, programacaotutoriaonline.turma, t.subturma, t.tiposubturma, t.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
14. 0.072 2.991 ↑ 1.0 13 3 / 3

Nested Loop Left Join (cost=22.53..62.07 rows=13 width=92) (actual time=1.769..2.991 rows=13 loops=3)

15. 1.084 2.542 ↑ 1.0 13 3 / 3

Hash Join (cost=22.25..49.89 rows=13 width=44) (actual time=1.571..2.542 rows=13 loops=3)

  • Hash Cond: (programacaotutoriaonline.codigo = programacaotutoriaonlineprofessor.programacaotutoriaonline)
16. 1.148 1.148 ↑ 1.0 967 3 / 3

Seq Scan on programacaotutoriaonline (cost=0.00..22.67 rows=967 width=40) (actual time=0.049..1.148 rows=967 loops=3)

17. 0.025 0.310 ↑ 1.0 13 3 / 3

Hash (cost=22.09..22.09 rows=13 width=12) (actual time=0.308..0.310 rows=13 loops=3)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
18. 0.285 0.285 ↑ 1.0 13 3 / 3

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..22.09 rows=13 width=12) (actual time=0.179..0.285 rows=13 loops=3)

  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 954
19. 0.377 0.377 ↑ 1.0 1 39 / 3

Index Scan using turma_pkey on turma t (cost=0.28..0.94 rows=1 width=12) (actual time=0.029..0.029 rows=1 loops=39)

  • Index Cond: (programacaotutoriaonline.turma = codigo)
20. 1.092 1.092 ↑ 1.0 1 156

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

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.matriculaperiodo)
21. 2.652 2.652 ↑ 1.0 1 156

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

  • Index Cond: ((matricula)::text = (matriculaperiodo.matricula)::text)
22. 1.560 1.560 ↑ 1.0 1 156

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

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

SubPlan (for Nested Loop)

24. 0.000 0.000 ↓ 0.0 0

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

25. 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))
26. 0.000 0.000 ↓ 0.0 0

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

27. 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)
28. 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)
29. 0.000 0.000 ↓ 0.0 0

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

30. 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))
31. 0.000 0.000 ↓ 0.0 0

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

32. 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
33. 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))
34. 0.000 0.000 ↓ 0.0 0

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

35. 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)
36. 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)
37. 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))
38. 0.000 0.000 ↓ 0.0 0

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

39. 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)
40. 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)
41. 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
42. 0.912 0.912 ↑ 1.0 1 152

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

  • Index Cond: (codigo = matricula.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
43. 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
44. 2.516 919.970 ↓ 545.0 545 1

Nested Loop (cost=7,825.83..16,394.07 rows=1 width=49) (actual time=401.164..919.970 rows=545 loops=1)

45. 2.224 915.274 ↓ 545.0 545 1

Nested Loop (cost=7,825.53..16,389.75 rows=1 width=53) (actual time=401.141..915.274 rows=545 loops=1)

  • 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)))
46. 2.802 910.870 ↓ 545.0 545 1

Nested Loop (cost=7,825.26..16,389.42 rows=1 width=57) (actual time=401.114..910.870 rows=545 loops=1)

  • 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 5))))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicocursandoporcorrespondenciaapostransferencia AND (historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 6) AND ((NOT historico_1.historicoporequivalencia) OR (historico_1.historicoporequivalencia IS NULL))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicoequivalente AND (SubPlan 7)) OR ((historico_1.matrizcurricular = matriculaperiodo_1.gradecurricular) AND (matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 8))))
47. 1.978 903.163 ↓ 545.0 545 1

Nested Loop (cost=7,824.83..16,255.01 rows=1 width=65) (actual time=401.071..903.163 rows=545 loops=1)

48. 0.000 893.010 ↓ 545.0 545 1

Nested Loop (cost=7,824.54..16,254.64 rows=1 width=69) (actual time=401.034..893.010 rows=545 loops=1)

49. 458.073 913.901 ↓ 545.0 545 1

Gather (cost=7,824.25..16,254.32 rows=1 width=53) (actual time=400.986..913.901 rows=545 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
50. 0.410 455.828 ↓ 182.0 182 3 / 3

Nested Loop (cost=6,824.25..15,254.22 rows=1 width=53) (actual time=450.406..455.828 rows=182 loops=3)

51. 0.016 450.683 ↑ 55.0 5 3 / 3

Parallel Append (cost=6,823.83..13,057.32 rows=275 width=25) (actual time=450.240..450.683 rows=5 loops=3)

52. 0.006 117.554 ↑ 117.8 5 1 / 3

Subquery Scan on *SELECT* 1 (cost=10,796.97..10,816.11 rows=589 width=25) (actual time=352.474..352.662 rows=5 loops=1)

53. 0.037 117.548 ↑ 117.8 5 1 / 3

Unique (cost=10,796.97..10,810.22 rows=589 width=69) (actual time=352.468..352.645 rows=5 loops=1)

54. 0.192 117.511 ↑ 7.9 75 1 / 3

Sort (cost=10,796.97..10,798.44 rows=589 width=69) (actual time=352.463..352.533 rows=75 loops=1)

  • Sort Key: horarioturma.codigo, t_1.codigo, t_1.subturma, t_1.tiposubturma, t_1.turmaagrupada, horarioturmadiaitem.disciplina, horarioturma.anovigente, horarioturma.semestrevigente
  • Worker 1: Sort Method: quicksort Memory: 35kB
55. 2.791 117.319 ↑ 7.9 75 1 / 3

Hash Join (cost=7,244.18..10,769.87 rows=589 width=69) (actual time=224.570..351.958 rows=75 loops=1)

  • Hash Cond: (horarioturma.turma = t_1.codigo)
  • Join Filter: ((t_1.semestral AND ((horarioturma.anovigente)::text = '2020'::text) AND ((horarioturma.semestrevigente)::text = '2'::text)) OR (t_1.anual AND ((horarioturma.anovigente)::text = '2020'::text)) OR ((NOT t_1.semestral) AND (NOT t_1.anual) AND (horarioturmadiaitem.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 3,923
56. 4.975 109.315 ↑ 1.1 6,490 1 / 3

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

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
57. 44.914 101.787 ↑ 1.1 6,490 1 / 3

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

  • Hash Cond: (horarioturmadia.codigo = horarioturmadiaitem.horarioturmadia)
58. 44.975 44.975 ↑ 1.0 102,793 1 / 3

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

59. 2.787 11.898 ↑ 1.1 6,490 1 / 3

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
60. 8.596 9.111 ↑ 1.1 6,490 1 / 3

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

  • Recheck Cond: (professor = 9,959)
61. 0.515 0.515 ↑ 1.1 6,490 1 / 3

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

  • Index Cond: (professor = 9,959)
62. 1.196 2.552 ↑ 1.0 2,970 1 / 3

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

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

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

64. 1.708 5.214 ↑ 1.0 3,888 1 / 3

Hash (cost=194.56..194.56 rows=4,044 width=14) (actual time=15.641..15.642 rows=3,888 loops=1)

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

Seq Scan on turma t_1 (cost=0.00..194.56 rows=4,044 width=14) (actual time=0.222..10.517 rows=3,888 loops=1)

  • Filter: ((NOT turmaagrupada) AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 1,968
66. 0.009 282.660 ↑ 5.8 10 1 / 3

Subquery Scan on *SELECT* 2 (cost=6,823.83..6,825.86 rows=58 width=25) (actual time=846.871..847.981 rows=10 loops=1)

67. 0.217 282.651 ↑ 5.8 10 1 / 3

Unique (cost=6,823.83..6,825.28 rows=58 width=69) (actual time=846.865..847.953 rows=10 loops=1)

68. 0.749 282.434 ↓ 8.3 480 1 / 3

Sort (cost=6,823.83..6,823.97 rows=58 width=69) (actual time=846.862..847.303 rows=480 loops=1)

  • Sort Key: horarioturma_1.codigo, turmaagrupada.turma, t_2.subturma, t_2.tiposubturma, t_2.turmaagrupada, horarioturmadiaitem_1.disciplina, horarioturma_1.anovigente, horarioturma_1.semestrevigente, horarioturma_1.turma
  • Worker 0: Sort Method: quicksort Memory: 92kB
69. 60.147 281.685 ↓ 8.3 480 1 / 3

Nested Loop (cost=266.41..6,822.13 rows=58 width=69) (actual time=341.039..845.055 rows=480 loops=1)

  • 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: 10,572
70. 47.251 98.720 ↓ 8.8 61,409 1 / 3

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

71. 4.796 12.613 ↓ 24.0 4,857 1 / 3

Hash Join (cost=265.69..367.92 rows=202 width=27) (actual time=17.070..37.838 rows=4,857 loops=1)

  • Hash Cond: (turmaagrupada.turmaorigem = t_2.codigo)
72. 2.258 2.258 ↑ 1.0 5,106 1 / 3

Seq Scan on turmaagrupada (cost=0.00..81.06 rows=5,106 width=8) (actual time=0.093..6.775 rows=5,106 loops=1)

73. 0.268 5.559 ↓ 2.6 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
74. 1.400 5.291 ↓ 2.6 607 1 / 3

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

  • Hash Cond: (horarioturma_1.turma = t_2.codigo)
75. 1.196 1.196 ↑ 1.0 2,970 1 / 3

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

76. 0.301 2.695 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_2 (cost=0.00..194.56 rows=458 width=14) (actual time=0.087..7.180 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
78. 38.856 38.856 ↑ 2.9 13 4,857 / 3

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_1 (cost=0.29..3.43 rows=38 width=8) (actual time=0.006..0.024 rows=13 loops=4,857)

  • Index Cond: (horarioturma = horarioturma_1.codigo)
79. 122.818 122.818 ↓ 0.0 0 61,409 / 3

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem horarioturmadiaitem_1 (cost=0.42..0.79 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=61,409)

  • Index Cond: (horarioturmadia = horarioturmadia_1.codigo)
  • Filter: (professor = 9,959)
  • Rows Removed by Filter: 4
80. 0.001 24.764 ↓ 0.0 0 1 / 3

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

81. 0.001 24.763 ↓ 0.0 0 1 / 3

Unique (cost=3,181.42..3,181.56 rows=5 width=69) (actual time=74.288..74.289 rows=0 loops=1)

82. 0.007 24.762 ↓ 0.0 0 1 / 3

Sort (cost=3,181.42..3,181.44 rows=5 width=69) (actual time=74.285..74.286 rows=0 loops=1)

  • Sort Key: horarioturma_2.codigo, turmaagrupada_1.turma, t_3.subturma, t_3.tiposubturma, t_3.turmaagrupada, disciplinaequivalente.equivalente, horarioturma_2.anovigente, horarioturma_2.semestrevigente, horarioturmadiaitem_2.disciplina, horarioturma_2.turma
  • Sort Method: quicksort Memory: 25kB
83. 0.001 24.755 ↓ 0.0 0 1 / 3

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

  • Join Filter: (t_3.codigo = turmaagrupada_1.turmaorigem)
84. 2.469 24.755 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,177.86 rows=6 width=37) (actual time=74.263..74.264 rows=0 loops=1)

  • Hash Cond: (horarioturmadia_2.horarioturma = horarioturma_2.codigo)
  • 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: 4,020
85. 5.380 17.821 ↓ 7.6 4,508 1 / 3

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

86. 3.233 6.430 ↓ 7.6 4,508 1 / 3

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

87. 0.015 0.015 ↑ 1.0 28 1 / 3

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

88. 3.183 3.183 ↓ 8.9 161 28 / 3

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem horarioturmadiaitem_2 (cost=0.42..73.76 rows=18 width=16) (actual time=0.009..0.341 rows=161 loops=28)

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

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

  • Index Cond: (codigo = horarioturmadiaitem_2.horarioturmadia)
90. 0.267 4.465 ↓ 2.6 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
91. 1.434 4.198 ↓ 2.6 607 1 / 3

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

  • Hash Cond: (horarioturma_2.turma = t_3.codigo)
92. 1.074 1.074 ↑ 1.0 2,970 1 / 3

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

93. 0.289 1.689 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_3 (cost=0.00..194.56 rows=458 width=14) (actual time=0.028..4.201 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
95. 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_2.turma)
96. 0.001 22.230 ↓ 0.0 0 1 / 3

Subquery Scan on *SELECT* 4 (cost=3,048.33..3,048.48 rows=4 width=25) (actual time=66.690..66.691 rows=0 loops=1)

97. 0.001 22.229 ↓ 0.0 0 1 / 3

Unique (cost=3,048.33..3,048.44 rows=4 width=69) (actual time=66.687..66.688 rows=0 loops=1)

98. 0.006 22.229 ↓ 0.0 0 1 / 3

Sort (cost=3,048.33..3,048.34 rows=4 width=69) (actual time=66.685..66.686 rows=0 loops=1)

  • Sort Key: horarioturma_3.codigo, turmaagrupada_2.turma, t_4.subturma, t_4.tiposubturma, t_4.turmaagrupada, disciplinaequivalente_1.disciplina, horarioturma_3.anovigente, horarioturma_3.semestrevigente, horarioturmadiaitem_3.disciplina, horarioturma_3.turma
  • Sort Method: quicksort Memory: 25kB
99. 0.001 22.223 ↓ 0.0 0 1 / 3

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

  • Join Filter: (t_4.codigo = turmaagrupada_2.turmaorigem)
100. 1.924 22.222 ↓ 0.0 0 1 / 3

Hash Join (cost=266.41..3,045.37 rows=5 width=37) (actual time=66.666..66.667 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: 2,052
101. 4.853 15.421 ↓ 7.7 3,839 1 / 3

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

102. 2.608 5.449 ↓ 7.7 3,839 1 / 3

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

103. 0.014 0.014 ↑ 1.0 28 1 / 3

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

104. 2.828 2.828 ↓ 7.6 137 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.303 rows=137 loops=28)

  • Index Cond: ((disciplina = disciplinaequivalente_1.equivalente) AND (professor = 9,959))
105. 5.119 5.119 ↑ 1.0 1 3,839 / 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=3,839)

  • Index Cond: (codigo = horarioturmadiaitem_3.horarioturmadia)
106. 0.309 4.877 ↓ 2.6 607 1 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 45kB
107. 1.519 4.568 ↓ 2.6 607 1 / 3

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

  • Hash Cond: (horarioturma_3.turma = t_4.codigo)
108. 1.073 1.073 ↑ 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.007..3.219 rows=2,970 loops=1)

109. 0.352 1.976 ↓ 1.4 630 1 / 3

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

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

Seq Scan on turma t_4 (cost=0.00..194.56 rows=458 width=14) (actual time=0.022..4.873 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
111. 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_3.turma)
112. 0.001 1.144 ↓ 0.0 0 1 / 3

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

113. 0.001 1.143 ↓ 0.0 0 1 / 3

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

114. 0.013 1.143 ↓ 0.0 0 1 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=3.427..3.428 rows=0 loops=1)

  • Sort Key: horarioturma_4.codigo, t_5.codigo, t_5.subturma, t_5.tiposubturma, t_5.turmaagrupada, disciplinaequivalente_2.disciplina, horarioturma_4.anovigente, horarioturma_4.semestrevigente, horarioturmadiaitem_4.disciplina
  • Sort Method: quicksort Memory: 25kB
115. 0.001 1.130 ↓ 0.0 0 1 / 3

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

116. 0.001 1.129 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=3.387..3.388 rows=0 loops=1)

  • 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))))
117. 0.001 1.129 ↓ 0.0 0 1 / 3

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

118. 0.005 1.128 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_4.turma = t_5.codigo)
119. 0.003 0.003 ↑ 2,970.0 1 1 / 3

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

120. 0.001 1.120 ↓ 0.0 0 1 / 3

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

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

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

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

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

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

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

  • Index Cond: (horarioturmadia = horarioturmadia_4.codigo)
  • Filter: (professor = 9,959)
124. 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_4.disciplina)
125. 0.001 0.990 ↓ 0.0 0 1 / 3

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

126. 0.001 0.989 ↓ 0.0 0 1 / 3

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

127. 0.005 0.988 ↓ 0.0 0 1 / 3

Sort (cost=728.08..728.08 rows=1 width=69) (actual time=2.963..2.964 rows=0 loops=1)

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

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

129. 0.001 0.983 ↓ 0.0 0 1 / 3

Nested Loop (cost=195.64..727.40 rows=4 width=33) (actual time=2.947..2.948 rows=0 loops=1)

  • Join Filter: ((t_6.semestral AND ((horarioturma_5.anovigente)::text = '2020'::text) AND ((horarioturma_5.semestrevigente)::text = '2'::text)) OR (t_6.anual AND ((horarioturma_5.anovigente)::text = '2020'::text)) OR ((NOT t_6.semestral) AND (NOT t_6.anual) AND (horarioturmadiaitem_5.data >= (CURRENT_DATE - '1 year'::interval))))
130. 0.001 0.982 ↓ 0.0 0 1 / 3

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

131. 0.003 0.981 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_5.turma = t_6.codigo)
132. 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)

133. 0.001 0.975 ↓ 0.0 0 1 / 3

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

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

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
135. 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)
136. 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)
137. 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_5.disciplina)
  • Heap Fetches: 0
138. 0.001 1.324 ↓ 0.0 0 1 / 3

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

139. 0.001 1.323 ↓ 0.0 0 1 / 3

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

140. 0.009 1.322 ↓ 0.0 0 1 / 3

Sort (cost=727.44..727.45 rows=4 width=69) (actual time=3.965..3.966 rows=0 loops=1)

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

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

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

143. 0.007 1.311 ↓ 0.0 0 1 / 3

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

  • Hash Cond: (horarioturma_6.turma = t_7.codigo)
144. 0.009 0.009 ↑ 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.025..0.026 rows=1 loops=1)

145. 0.001 1.295 ↓ 0.0 0 1 / 3

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

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

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

  • Filter: (turmaagrupada AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))))
  • Rows Removed by Filter: 5,856
147. 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)
148. 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)
149. 4.735 4.735 ↓ 36.0 36 15 / 3

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.42..7.98 rows=1 width=41) (actual time=0.089..0.947 rows=36 loops=15)

  • Index Cond: ((turma = "*SELECT* 1".turma) AND (disciplina = "*SELECT* 1".disciplina))
  • Filter: ((turmapratica IS NULL) AND (turmateorica IS NULL) AND (turmapratica IS NULL) AND (turmateorica IS NULL) AND (("*SELECT* 1".ano)::text = (ano)::text) AND (("*SELECT* 1".semestre)::text = (semestre)::text))
  • Rows Removed by Filter: 29
150. 3.270 3.270 ↑ 1.0 1 545

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

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
151. 8.175 8.175 ↑ 1.0 1 545

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

  • Index Cond: ((matricula)::text = (matriculaperiodo_1.matricula)::text)
152. 4.905 4.905 ↑ 1.0 1 545

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_1 (cost=0.42..0.68 rows=1 width=49) (actual time=0.008..0.009 rows=1 loops=545)

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

SubPlan (for Nested Loop)

154. 0.000 0.000 ↓ 0.0 0

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

155. 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))
156. 0.000 0.000 ↓ 0.0 0

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

157. 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)
158. 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)
159. 0.000 0.000 ↓ 0.0 0

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

160. 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))
161. 0.000 0.000 ↓ 0.0 0

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

162. 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
163. 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))
164. 0.000 0.000 ↓ 0.0 0

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

165. 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)
166. 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)
167. 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))
168. 0.000 0.000 ↓ 0.0 0

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

169. 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)
170. 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)
171. 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
172. 2.180 2.180 ↑ 1.0 1 545

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

  • Index Cond: (codigo = matricula_1.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
173. 2.180 2.180 ↑ 1.0 1 545

Index Only Scan using pessoa_pkey on pessoa professor_1 (cost=0.29..4.31 rows=1 width=4) (actual time=0.003..0.004 rows=1 loops=545)

  • Index Cond: (codigo = 9,959)
  • Heap Fetches: 0
174. 0.002 7.966 ↓ 0.0 0 1

Nested Loop (cost=240.26..1,120.50 rows=1 width=49) (actual time=7.965..7.966 rows=0 loops=1)

175. 0.002 7.964 ↓ 0.0 0 1

Nested Loop (cost=239.97..1,116.18 rows=1 width=53) (actual time=7.963..7.964 rows=0 loops=1)

  • Join Filter: ((matriculaperiodoturmadisciplina_2.turmapratica = "*SELECT* 1_1".turma) AND (matriculaperiodoturmadisciplina_2.disciplina = "*SELECT* 1_1".disciplina) AND ((matriculaperiodoturmadisciplina_2.ano)::text = ("*SELECT* 1_1".ano)::text) AND ((matriculaperiodoturmadisciplina_2.semestre)::text = ("*SELECT* 1_1".semestre)::text))
176. 0.246 7.962 ↓ 0.0 0 1

Nested Loop (cost=1.71..159.63 rows=1 width=41) (actual time=7.961..7.962 rows=0 loops=1)

  • 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
177. 0.369 7.356 ↓ 45.0 45 1

Nested Loop (cost=1.43..159.30 rows=1 width=45) (actual time=0.114..7.356 rows=45 loops=1)

  • 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 9))))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicocursandoporcorrespondenciaapostransferencia AND (historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 10) AND ((NOT historico_2.historicoporequivalencia) OR (historico_2.historicoporequivalencia IS NULL))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicoequivalente AND (SubPlan 11)) OR ((historico_2.matrizcurricular = matriculaperiodo_2.gradecurricular) AND (matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 12))))
  • Rows Removed by Join Filter: 6
178. 0.236 2.100 ↓ 51.0 51 1

Nested Loop (cost=1.01..17.12 rows=1 width=53) (actual time=0.076..2.100 rows=51 loops=1)

179. 0.284 0.844 ↓ 51.0 51 1

Nested Loop (cost=0.72..16.76 rows=1 width=57) (actual time=0.044..0.844 rows=51 loops=1)

180. 0.203 0.203 ↓ 51.0 51 1

Index Scan using idx_mptd_turmapratica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.42..8.45 rows=1 width=41) (actual time=0.021..0.203 rows=51 loops=1)

  • Index Cond: ((turmapratica IS NOT NULL) AND (turmapratica IS NOT NULL))
181. 0.357 0.357 ↑ 1.0 1 51

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

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
182. 1.020 1.020 ↑ 1.0 1 51

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

  • Index Cond: ((matricula)::text = (matriculaperiodo_2.matricula)::text)
183. 0.663 0.663 ↑ 1.0 1 51

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_2 (cost=0.42..8.45 rows=1 width=49) (actual time=0.012..0.013 rows=1 loops=51)

  • 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))
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_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))
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_2.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_2.disciplina)
190. 0.055 4.224 ↑ 1.0 1 11

Limit (cost=0.42..50.64 rows=1 width=4) (actual time=0.384..0.384 rows=1 loops=11)

191. 4.169 4.169 ↑ 1.0 1 11

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.379..0.379 rows=1 loops=11)

  • 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
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_10.matricula)::text, (his_10.anohistorico)::text, (his_10.semestrehistorico)::text, his_10.disciplina, his_10.transferenciamatrizcurricularmatricula
194. 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))
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_2.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_2.gradecurricularatual)
198. 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))
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_2.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_10.disciplina)
202. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_11 (cost=0.42..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
203. 0.360 0.360 ↑ 1.0 1 45

Index Scan using curso_pkey on curso curso_2 (cost=0.28..0.30 rows=1 width=6) (actual time=0.007..0.008 rows=1 loops=45)

  • Index Cond: (codigo = matricula_2.curso)
  • Filter: (((periodicidade)::text = 'IN'::text) OR ((periodicidade)::text = 'AN'::text) OR ((periodicidade)::text = 'SE'::text))
204. 0.000 0.000 ↓ 0.0 0

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

205. 0.000 0.000 ↓ 0.0 0

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

206. 0.000 0.000 ↓ 0.0 0

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

207. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_7.codigo, t_8.codigo, t_8.subturma, t_8.turmaagrupada, horarioturmadiaitem_7.disciplina, horarioturma_7.anovigente, horarioturma_7.semestrevigente
208. 0.000 0.000 ↓ 0.0 0

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

  • 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))))
209. 0.000 0.000 ↓ 0.0 0

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

210. 0.000 0.000 ↓ 0.0 0

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

211. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_8 (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))
212. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turma = t_8.codigo)
213. 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_8.codigo)
214. 0.000 0.000 ↓ 0.0 0

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

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

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

217. 0.000 0.000 ↓ 0.0 0

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

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

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

221. 0.000 0.000 ↓ 0.0 0

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

222. 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: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'PRATICA'::text))
223. 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)
224. 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)
225. 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)
226. 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)
227. 0.000 0.000 ↓ 0.0 0

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

228. 0.000 0.000 ↓ 0.0 0

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

229. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_9.codigo, t_10.codigo, t_10.subturma, t_10.turmaagrupada, disciplinaequivalente_4.equivalente, horarioturma_9.anovigente, horarioturma_9.semestrevigente, horarioturmadiaitem_9.disciplina
230. 0.000 0.000 ↓ 0.0 0

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

  • Join Filter: (horarioturmadiaitem_9.disciplina = disciplinaequivalente_4.disciplina)
231. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 rows=1 width=33) (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))))
232. 0.000 0.000 ↓ 0.0 0

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

233. 0.000 0.000 ↓ 0.0 0

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

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

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

240. 0.000 0.000 ↓ 0.0 0

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

241. 0.000 0.000 ↓ 0.0 0

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

242. 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_5.disciplina, horarioturma_10.anovigente, horarioturma_10.semestrevigente, horarioturmadiaitem_10.disciplina
243. 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_5.equivalente)
244. 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))))
245. 0.000 0.000 ↓ 0.0 0

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

246. 0.000 0.000 ↓ 0.0 0

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

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

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

253. 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
254. 0.003 0.031 ↓ 0.0 0 1

Nested Loop (cost=240.26..1,120.50 rows=1 width=49) (actual time=0.030..0.031 rows=0 loops=1)

255. 0.002 0.028 ↓ 0.0 0 1

Nested Loop (cost=239.97..1,116.18 rows=1 width=53) (actual time=0.028..0.028 rows=0 loops=1)

  • Join Filter: ((matriculaperiodoturmadisciplina_3.turmateorica = "*SELECT* 1_2".turma) AND (matriculaperiodoturmadisciplina_3.disciplina = "*SELECT* 1_2".disciplina) AND ((matriculaperiodoturmadisciplina_3.ano)::text = ("*SELECT* 1_2".ano)::text) AND ((matriculaperiodoturmadisciplina_3.semestre)::text = ("*SELECT* 1_2".semestre)::text))
256. 0.002 0.026 ↓ 0.0 0 1

Nested Loop (cost=1.71..159.63 rows=1 width=41) (actual time=0.025..0.026 rows=0 loops=1)

  • 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)))
257. 0.004 0.024 ↓ 0.0 0 1

Nested Loop (cost=1.43..159.30 rows=1 width=45) (actual time=0.023..0.024 rows=0 loops=1)

  • 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 13))))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicocursandoporcorrespondenciaapostransferencia AND (historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (SubPlan 14) AND ((NOT historico_3.historicoporequivalencia) OR (historico_3.historicoporequivalencia IS NULL))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicoequivalente AND (SubPlan 15)) OR ((historico_3.matrizcurricular = matriculaperiodo_3.gradecurricular) AND (matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 16))))
258. 0.003 0.020 ↓ 0.0 0 1

Nested Loop (cost=1.01..17.12 rows=1 width=53) (actual time=0.019..0.020 rows=0 loops=1)

259. 0.003 0.017 ↓ 0.0 0 1

Nested Loop (cost=0.72..16.76 rows=1 width=57) (actual time=0.016..0.017 rows=0 loops=1)

260. 0.014 0.014 ↓ 0.0 0 1

Index Scan using idx_mptd_turmateorica on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.42..8.45 rows=1 width=41) (actual time=0.013..0.014 rows=0 loops=1)

  • Index Cond: ((turmateorica IS NOT NULL) AND (turmateorica IS NOT NULL))
261. 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)
262. 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)
263. 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))
264.          

SubPlan (for Nested Loop)

265. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

271. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_13 (cost=0.42..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))
272. 0.000 0.000 ↓ 0.0 0

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

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

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

276. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (matrizcurricular = matricula_3.gradecurricularatual)
278. 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))
279. 0.000 0.000 ↓ 0.0 0

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

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

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

285. 0.000 0.000 ↓ 0.0 0

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

286. 0.000 0.000 ↓ 0.0 0

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

287. 0.000 0.000 ↓ 0.0 0

Sort (cost=238.26..238.27 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_11.codigo, t_12.codigo, t_12.subturma, t_12.turmaagrupada, horarioturmadiaitem_11.disciplina, horarioturma_11.anovigente, horarioturma_11.semestrevigente
288. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 rows=1 width=69) (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))))
289. 0.000 0.000 ↓ 0.0 0

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

290. 0.000 0.000 ↓ 0.0 0

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

291. 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: ((NOT turmaagrupada) AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
292. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turma = t_12.codigo)
293. 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)
294. 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)
295. 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)
296. 0.000 0.000 ↓ 0.0 0

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

297. 0.000 0.000 ↓ 0.0 0

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

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

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

301. 0.000 0.000 ↓ 0.0 0

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

302. 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: (turmaagrupada AND subturma AND subturma AND (semestral OR anual OR ((NOT semestral) AND (NOT anual))) AND ((tiposubturma)::text = 'TEORICA'::text))
303. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turma = t_13.codigo)
304. 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)
305. 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)
306. 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)
307. 0.000 0.000 ↓ 0.0 0

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

308. 0.000 0.000 ↓ 0.0 0

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

309. 0.000 0.000 ↓ 0.0 0

Sort (cost=239.89..239.90 rows=1 width=69) (never executed)

  • Sort Key: horarioturma_13.codigo, t_14.codigo, t_14.subturma, t_14.turmaagrupada, disciplinaequivalente_6.equivalente, horarioturma_13.anovigente, horarioturma_13.semestrevigente, horarioturmadiaitem_13.disciplina
310. 0.000 0.000 ↓ 0.0 0

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

  • Join Filter: (horarioturmadiaitem_13.disciplina = disciplinaequivalente_6.disciplina)
311. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.01..238.25 rows=1 width=33) (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))))
312. 0.000 0.000 ↓ 0.0 0

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

313. 0.000 0.000 ↓ 0.0 0

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

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

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

320. 0.000 0.000 ↓ 0.0 0

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

321. 0.000 0.000 ↓ 0.0 0

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

322. 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_7.disciplina, horarioturma_14.anovigente, horarioturma_14.semestrevigente, horarioturmadiaitem_14.disciplina
323. 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_7.equivalente)
324. 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))))
325. 0.000 0.000 ↓ 0.0 0

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

326. 0.000 0.000 ↓ 0.0 0

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

327. 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))
328. 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)
329. 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)
330. 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)
331. 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)
332. 0.000 0.000 ↓ 0.0 0

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

333. 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
Planning time : 91.076 ms
Execution time : 1,111.169 ms