explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hPBI

Settings
# exclusive inclusive rows x rows loops node
1. 0.463 3,139.059 ↓ 63.0 63 1

Sort (cost=41,234.76..41,234.77 rows=1 width=398) (actual time=3,138.963..3,139.059 rows=63 loops=1)

  • Sort Key: t."Pessoa.nome
  • Sort Method: quicksort Memory: 57kB
2. 0.544 3,138.596 ↓ 63.0 63 1

Subquery Scan on t (cost=40,507.37..41,234.75 rows=1 width=398) (actual time=2,725.842..3,138.596 rows=63 loops=1)

  • Filter: ((alternatives: SubPlan 12 or hashed SubPlan 24) OR (NOT (alternatives: SubPlan 36 or hashed SubPlan 48)))
3. 0.829 2,712.550 ↓ 63.0 63 1

Unique (cost=40,507.37..40,507.54 rows=1 width=398) (actual time=2,711.598..2,712.550 rows=63 loops=1)

4. 0.871 2,711.721 ↓ 63.0 63 1

Sort (cost=40,507.37..40,507.38 rows=1 width=398) (actual time=2,711.592..2,711.721 rows=63 loops=1)

  • Sort Key: "*SELECT* 1".matricula, "*SELECT* 1".turma, "*SELECT* 1".turmateorica, "*SELECT* 1".turmapratica, "*SELECT* 1".permiteescolhermodalidade, "*SELECT* 1".conteudo, "*SELECT* 1".modalidadedisciplina, "*SELECT* 1".matriculaperiodo, "*SELECT* 1".semestre, "*SELECT* 1".ano, "*SELECT* 1".codigo, "*SELECT* 1".disciplina, "*SELECT* 1".disciplinaincluida, "*SELECT* 1".disciplinaequivale, "*SELECT* 1".disciplinaequivalente, "*SELECT* 1".disciplinafazpartecomposicao, "*SELECT* 1".justificativa, "*SELECT* 1".observacaojustificativa, "*SELECT* 1".inclusaoforaprazo, matriculaperiodo.data, matriculaperiodo.situacao, matriculaperiodo.alunotransferidounidade, matriculaperiodo.situacaomatriculaperiodo, matriculaperiodo.datafechamentomatriculaperiodo, matriculaperiodo.unidadeensinocurso, matriculaperiodo.processomatricula, matriculaperiodo.gradecurricular, matriculaperiodo.turma, matriculaperiodo.periodoletivomatricula, matricula.gradecurricularatual, matricula.data, matricula.matriculasuspensa, matricula.updated, matricula.turno, matricula.situacao, matricula.situacaofinanceira, pessoa.nome, pessoa.codigo, pessoa.cpf, turma.semestral, turma.anual, turma.identificadorturma, turma.turmaagrupada, turma.sala, turma.gradecurricular, turma.chancela, turma.tipochancela, turma.porcentagemchancela, turma.valorfixochancela, turma.valorporaluno, turma.qtdalunosestimado, turma.customedioaluno, turma.receitamediaaluno, chancela.instituicaochanceladora, unidadeensino.codigo, unidadeensino.nome, curso.codigo, curso.nome, curso.periodicidade, curso.configuracaoacademico, curso.niveleducacional, turno.codigo, turno.nome, periodoletivo.descricao, periodoletivo.codigo, historico.dataregistro
  • Sort Method: quicksort Memory: 57kB
5. 0.487 2,710.850 ↓ 63.0 63 1

Nested Loop Left Join (cost=11,092.41..40,507.36 rows=1 width=398) (actual time=2,614.588..2,710.850 rows=63 loops=1)

6. 0.463 2,705.638 ↓ 63.0 63 1

Nested Loop Left Join (cost=11,092.29..40,507.21 rows=1 width=364) (actual time=2,614.558..2,705.638 rows=63 loops=1)

7. 0.439 2,704.797 ↓ 63.0 63 1

Nested Loop Left Join (cost=11,092.01..40,506.91 rows=1 width=349) (actual time=2,614.512..2,704.797 rows=63 loops=1)

8. 0.427 2,704.043 ↓ 63.0 63 1

Nested Loop Left Join (cost=11,091.87..40,506.76 rows=1 width=334) (actual time=2,614.477..2,704.043 rows=63 loops=1)

9. 0.396 2,703.238 ↓ 63.0 63 1

Nested Loop (cost=11,091.73..40,506.59 rows=1 width=318) (actual time=2,614.440..2,703.238 rows=63 loops=1)

10. 0.468 2,702.149 ↓ 63.0 63 1

Nested Loop (cost=11,091.31..40,506.02 rows=1 width=279) (actual time=2,614.400..2,702.149 rows=63 loops=1)

  • Join Filter: (((curso.periodicidade)::text = 'IN'::text) OR (((curso.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 49)))
11. 0.572 2,701.240 ↓ 63.0 63 1

Nested Loop (cost=11,091.03..40,503.05 rows=1 width=234) (actual time=2,614.360..2,701.240 rows=63 loops=1)

  • Join Filter: ((("*SELECT* 1".matricula)::text = (matricula.matricula)::text) AND (((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 56))))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicocursandoporcorrespondenciaapostransferencia AND (historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico.disciplina = (SubPlan 57)) AND ((NOT historico.historicoporequivalencia) OR (historico.historicoporequivalencia IS NULL))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicoequivalente AND (SubPlan 58)) OR ((historico.matrizcurricular = matriculaperiodo.gradecurricular) AND (matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 59)))))
12. 0.459 2,699.471 ↓ 63.0 63 1

Nested Loop (cost=11,090.61..40,434.72 rows=1 width=225) (actual time=2,614.291..2,699.471 rows=63 loops=1)

13. 1.448 2,674.190 ↑ 213.9 63 1

Hash Join (cost=11,090.18..13,449.09 rows=13,474 width=173) (actual time=2,614.237..2,674.190 rows=63 loops=1)

  • Hash Cond: ("*SELECT* 1".disciplina = disciplina.codigo)
14. 17.642 2,670.348 ↑ 20.7 745 1

Hash Join (cost=10,820.67..13,139.13 rows=15,399 width=173) (actual time=2,611.592..2,670.348 rows=745 loops=1)

  • Hash Cond: ("*SELECT* 1".turma = turma.codigo)
  • Join Filter: ((turma.codigo = 97,392) OR (hashed SubPlan 50) OR (hashed SubPlan 51) OR (hashed SubPlan 52))
15. 15.628 2,331.726 ↑ 23.6 745 1

Hash Join (cost=9,703.39..11,975.63 rows=17,599 width=112) (actual time=2,290.267..2,331.726 rows=745 loops=1)

  • Hash Cond: ("*SELECT* 1".matriculaperiodo = matriculaperiodo.codigo)
16. 14.343 26.704 ↑ 26.9 937 1

Append (cost=0.72..2,206.76 rows=25,219 width=65) (actual time=0.329..26.704 rows=937 loops=1)

17. 0.003 0.043 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=0.72..650.00 rows=611 width=65) (actual time=0.042..0.043 rows=0 loops=1)

18. 0.006 0.040 ↓ 0.0 0 1

Nested Loop (cost=0.72..643.89 rows=611 width=219) (actual time=0.039..0.040 rows=0 loops=1)

19. 0.020 0.020 ↑ 1.0 1 1

Index Only Scan using turma_pkey on turma turmanormal (cost=0.29..1.41 rows=1 width=4) (actual time=0.017..0.020 rows=1 loops=1)

  • Index Cond: (codigo = 97,392)
  • Heap Fetches: 0
20. 0.014 0.014 ↓ 0.0 0 1

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd (cost=0.43..636.37 rows=611 width=65) (actual time=0.013..0.014 rows=0 loops=1)

  • Index Cond: (turma = 97,392)
21. 2.563 10.843 ↑ 26.3 937 1

Subquery Scan on *SELECT* 2 (cost=31.18..1,178.11 rows=24,606 width=65) (actual time=0.282..10.843 rows=937 loops=1)

22. 3.559 8.280 ↑ 26.3 937 1

Nested Loop (cost=31.18..932.05 rows=24,606 width=219) (actual time=0.278..8.280 rows=937 loops=1)

23. 0.322 1.021 ↓ 1.3 50 1

Nested Loop (cost=30.75..78.74 rows=38 width=8) (actual time=0.251..1.021 rows=50 loops=1)

24. 0.228 0.349 ↓ 1.3 50 1

HashAggregate (cost=30.46..30.84 rows=38 width=4) (actual time=0.234..0.349 rows=50 loops=1)

  • Group Key: ta.turma
25. 0.121 0.121 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada ta (cost=0.29..30.37 rows=38 width=4) (actual time=0.020..0.121 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
26. 0.350 0.350 ↑ 1.0 1 50

Index Only Scan using turma_pkey on turma turmanormal_1 (cost=0.29..1.26 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=50)

  • Index Cond: (codigo = ta.turma)
  • Heap Fetches: 16
27. 3.700 3.700 ↑ 34.1 19 50

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd_1 (cost=0.43..15.98 rows=648 width=65) (actual time=0.009..0.074 rows=19 loops=50)

  • Index Cond: (turma = turmanormal_1.codigo)
28. 0.003 0.731 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=1.29..126.28 rows=1 width=65) (actual time=0.730..0.731 rows=0 loops=1)

29. 0.003 0.728 ↓ 0.0 0 1

Nested Loop (cost=1.29..126.27 rows=1 width=219) (actual time=0.727..0.728 rows=0 loops=1)

30. 0.003 0.725 ↓ 0.0 0 1

Nested Loop (cost=1.00..123.76 rows=1 width=69) (actual time=0.724..0.725 rows=0 loops=1)

31. 0.184 0.722 ↓ 0.0 0 1

Nested Loop (cost=0.57..121.10 rows=1 width=12) (actual time=0.721..0.722 rows=0 loops=1)

32. 0.138 0.138 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada ta_1 (cost=0.29..30.37 rows=38 width=8) (actual time=0.030..0.138 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
33. 0.400 0.400 ↓ 0.0 0 50

Index Scan using turma_pkey on turma t_1 (cost=0.29..2.33 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=50)

  • Index Cond: (codigo = ta_1.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
  • Rows Removed by Filter: 1
34. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_mptd_turmapratica on matriculaperiodoturmadisciplina mptd_2 (cost=0.43..2.65 rows=1 width=65) (never executed)

  • Index Cond: (turmapratica = ta_1.turma)
35. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
36. 0.003 0.744 ↓ 0.0 0 1

Subquery Scan on *SELECT* 4 (cost=1.29..126.28 rows=1 width=65) (actual time=0.743..0.744 rows=0 loops=1)

37. 0.003 0.741 ↓ 0.0 0 1

Nested Loop (cost=1.29..126.27 rows=1 width=219) (actual time=0.740..0.741 rows=0 loops=1)

38. 0.003 0.738 ↓ 0.0 0 1

Nested Loop (cost=1.00..123.76 rows=1 width=69) (actual time=0.737..0.738 rows=0 loops=1)

39. 0.201 0.735 ↓ 0.0 0 1

Nested Loop (cost=0.57..121.10 rows=1 width=12) (actual time=0.733..0.735 rows=0 loops=1)

40. 0.134 0.134 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada ta_2 (cost=0.29..30.37 rows=38 width=8) (actual time=0.023..0.134 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
41. 0.400 0.400 ↓ 0.0 0 50

Index Scan using turma_pkey on turma t_2 (cost=0.29..2.33 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=50)

  • Index Cond: (codigo = ta_2.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
  • Rows Removed by Filter: 1
42. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_mptd_turmateorica on matriculaperiodoturmadisciplina mptd_3 (cost=0.43..2.65 rows=1 width=65) (never executed)

  • Index Cond: (turmateorica = ta_2.turma)
43. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_1 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
44. 810.831 2,289.394 ↓ 1.0 124,600 1

Hash (cost=8,149.00..8,149.00 rows=124,294 width=47) (actual time=2,289.392..2,289.394 rows=124,600 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 11,246kB
45. 1,478.563 1,478.563 ↓ 1.0 124,600 1

Seq Scan on matriculaperiodo (cost=0.00..8,149.00 rows=124,294 width=47) (actual time=0.022..1,478.563 rows=124,600 loops=1)

  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
  • Rows Removed by Filter: 53,602
46. 159.247 320.781 ↑ 1.0 18,426 1

Hash (cost=609.26..609.26 rows=18,426 width=61) (actual time=320.779..320.781 rows=18,426 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,054kB
47. 161.534 161.534 ↑ 1.0 18,426 1

Seq Scan on turma (cost=0.00..609.26 rows=18,426 width=61) (actual time=0.019..161.534 rows=18,426 loops=1)

48.          

SubPlan (for Hash Join)

49. 0.199 0.199 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_12 (cost=0.29..30.37 rows=38 width=4) (actual time=0.040..0.199 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
50. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

52. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_13 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
53. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_13 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_13.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
54. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_10 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
55. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

56. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

57. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_14 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
58. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_14 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_14.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
59. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_11 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
60. 0.009 2.394 ↑ 5,843.0 1 1

Hash (cost=196.48..196.48 rows=5,843 width=4) (actual time=2.392..2.394 rows=1 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 65kB
61. 2.328 2.385 ↑ 5,843.0 1 1

Index Only Scan using disciplina_pkey on disciplina (cost=6.43..196.48 rows=5,843 width=4) (actual time=2.171..2.385 rows=1 loops=1)

  • Filter: ((codigo = 7,459) OR (hashed SubPlan 53) OR (hashed SubPlan 54) OR (hashed SubPlan 55))
  • Rows Removed by Filter: 6,677
  • Heap Fetches: 0
62.          

SubPlan (for Index Only Scan)

63. 0.022 0.022 ↑ 1.0 1 1

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_4 (cost=0.42..2.64 rows=1 width=4) (actual time=0.018..0.022 rows=1 loops=1)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
64. 0.010 0.010 ↓ 0.0 0 1

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_8 (cost=0.14..1.26 rows=1 width=4) (actual time=0.009..0.010 rows=0 loops=1)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
65. 0.025 0.025 ↓ 0.0 0 1

Seq Scan on disciplinaequivalente disciplinaequivalente_9 (cost=0.00..2.24 rows=1 width=4) (actual time=0.024..0.025 rows=0 loops=1)

  • Filter: (equivalente = 7,459)
  • Rows Removed by Filter: 99
66. 24.822 24.822 ↑ 1.0 1 63

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.43..1.99 rows=1 width=56) (actual time=0.391..0.394 rows=1 loops=63)

  • Index Cond: (matriculaperiodoturmadisciplina = "*SELECT* 1".codigo)
  • Filter: ((("*SELECT* 1".matricula)::text = (matricula)::text) AND ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[])))
67. 1.197 1.197 ↑ 1.0 1 63

Index Scan using matricula_pkey on matricula (cost=0.42..0.44 rows=1 width=53) (actual time=0.019..0.019 rows=1 loops=63)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
68.          

SubPlan (for Nested Loop)

69. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.43..25.39 rows=1 width=4) (never executed)

70. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_16 (cost=0.43..25.39 rows=1 width=4) (never executed)

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

Limit (cost=13.17..14.29 rows=1 width=4) (never executed)

72. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_17 (cost=13.17..14.29 rows=1 width=4) (never executed)

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

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

74. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

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

Nested Loop Semi Join (cost=13.60..39.53 rows=1 width=0) (never executed)

77. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_4 (cost=0.43..25.23 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico.numeroagrupamentoequivalenciadisciplina))
78. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_18 (cost=13.17..14.29 rows=1 width=24) (never executed)

  • Recheck Cond: (((matricula)::text = (historico.matricula)::text) AND (disciplina = hist_4.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula.gradecurricularatual) AND ((hist_4.anohistorico)::text = (anohistorico)::text) AND ((hist_4.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_4.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
79. 0.000 0.000 ↓ 0.0 0

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

80. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = hist_4.disciplina)
82. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_19 (cost=0.56..1.68 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico.disciplina) AND (matriculaperiodo = historico.matriculaperiodo) AND (matrizcurricular = matricula.gradecurricularatual))
  • Heap Fetches: 0
83. 0.441 0.441 ↑ 1.0 1 63

Index Scan using curso_pkey on curso (cost=0.28..0.29 rows=1 width=63) (actual time=0.007..0.007 rows=1 loops=63)

  • Index Cond: (codigo = matricula.curso)
84.          

SubPlan (for Nested Loop)

85. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.66..2.67 rows=1 width=40) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.66..2.67 rows=1 width=40) (never executed)

  • Sort Key: ((((mp_4.ano)::text || '/'::text) || (mp_4.semestre)::text)) DESC, (CASE WHEN ((mp_4.situacaomatriculaperiodo)::text = ANY ('{AT,PR,FI,FO}'::text[])) THEN 1 ELSE 2 END), mp_4.codigo DESC
87. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo mp_4 (cost=0.42..2.65 rows=1 width=40) (never executed)

  • Index Cond: (((matricula)::text = (matricula.matricula)::text) AND ((ano)::text = ("*SELECT* 1".ano)::text) AND ((semestre)::text = ("*SELECT* 1".semestre)::text))
88. 0.693 0.693 ↑ 1.0 1 63

Index Scan using pessoa_pkey on pessoa (cost=0.42..0.56 rows=1 width=43) (actual time=0.011..0.011 rows=1 loops=63)

  • Index Cond: (codigo = matricula.aluno)
89. 0.378 0.378 ↑ 1.0 1 63

Index Scan using unidadeensino_pkey on unidadeensino (cost=0.14..0.17 rows=1 width=20) (actual time=0.006..0.006 rows=1 loops=63)

  • Index Cond: (turma.unidadeensino = codigo)
90. 0.315 0.315 ↑ 1.0 1 63

Index Scan using turno_pkey on turno (cost=0.14..0.16 rows=1 width=19) (actual time=0.005..0.005 rows=1 loops=63)

  • Index Cond: (turma.turno = codigo)
91. 0.378 0.378 ↑ 1.0 1 63

Index Scan using periodoletivo_pkey on periodoletivo (cost=0.28..0.30 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=63)

  • Index Cond: (turma.periodoletivo = codigo)
92. 4.725 4.725 ↑ 1.0 1 63

Index Scan using pk_chancela_codigo on chancela (cost=0.12..0.14 rows=1 width=9) (actual time=0.075..0.075 rows=1 loops=63)

  • Index Cond: (turma.chancela = codigo)
93.          

SubPlan (for Subquery Scan)

94. 0.252 425.502 ↑ 1.0 1 63

Result (cost=298.71..363.60 rows=1 width=0) (actual time=6.754..6.754 rows=1 loops=63)

  • One-Time Filter: (t."MatriculaPeriodoTurmaDisciplina.disciplina" = 7,459)
95. 0.504 425.250 ↑ 1.0 1 63

Nested Loop (cost=298.71..363.60 rows=1 width=0) (actual time=6.750..6.750 rows=1 loops=63)

96. 0.441 423.738 ↑ 1.0 1 63

Nested Loop (cost=20.72..83.48 rows=1 width=12) (actual time=6.726..6.726 rows=1 loops=63)

97. 0.693 405.531 ↑ 1.0 1 63

Nested Loop (cost=20.30..80.84 rows=1 width=16) (actual time=6.437..6.437 rows=1 loops=63)

98. 11.214 396.081 ↑ 1.0 1 63

Hash Join (cost=13.87..73.63 rows=1 width=20) (actual time=6.287..6.287 rows=1 loops=63)

  • Hash Cond: (curso_1.codigo = matricula_1.curso)
  • Join Filter: ((((curso_1.periodicidade)::text = 'IN'::text) OR (((curso_1.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 1))) AND (((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 8))))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicocursandoporcorrespondenciaapostransferencia AND (historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_1.disciplina = (SubPlan 9)) AND ((NOT historico_1.historicoporequivalencia) OR (historico_1.historicoporequivalencia IS NULL))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicoequivalente AND (SubPlan 10)) OR ((historico_1.matrizcurricular = matriculaperiodo_1.gradecurricular) AND (matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 11)))))
99. 98.436 382.536 ↓ 84.0 84 63

Nested Loop (cost=11.22..70.98 rows=1 width=91) (actual time=1.494..6.072 rows=84 loops=63)

100. 47.187 120.141 ↓ 84.0 84 63

Nested Loop (cost=10.80..68.33 rows=1 width=87) (actual time=0.586..1.907 rows=84 loops=63)

101. 0.882 35.910 ↑ 1.0 1 63

Nested Loop (cost=10.80..14.33 rows=1 width=80) (actual time=0.570..0.570 rows=1 loops=63)

102. 0.945 10.836 ↑ 1.0 1 63

Bitmap Heap Scan on historico historico_1 (cost=10.37..11.49 rows=1 width=48) (actual time=0.172..0.172 rows=1 loops=63)

  • Recheck Cond: (((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text) AND (disciplina = 7,459))
  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
  • Heap Blocks: exact=63
103. 0.504 9.891 ↓ 0.0 0 63

BitmapAnd (cost=10.37..10.37 rows=1 width=0) (actual time=0.157..0.157 rows=0 loops=63)

104. 5.544 5.544 ↑ 1.8 12 63

Bitmap Index Scan on idx_historico_matricula_gradedisciplina (cost=0.00..1.70 rows=22 width=0) (actual time=0.088..0.088 rows=12 loops=63)

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
105. 3.843 3.843 ↑ 1.7 358 63

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..8.42 rows=626 width=0) (actual time=0.061..0.061 rows=358 loops=63)

  • Index Cond: (disciplina = 7,459)
106. 24.192 24.192 ↑ 1.0 1 63

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina (cost=0.43..2.65 rows=1 width=40) (actual time=0.384..0.384 rows=1 loops=63)

  • Index Cond: (codigo = historico_1.matriculaperiodoturmadisciplina)
  • Filter: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
107. 37.044 37.044 ↑ 7.1 84 63

Seq Scan on curso curso_1 (cost=0.00..48.00 rows=600 width=7) (actual time=0.004..0.588 rows=84 loops=63)

108. 163.959 163.959 ↑ 1.0 1 5,289

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_1 (cost=0.42..2.65 rows=1 width=8) (actual time=0.031..0.031 rows=1 loops=5,289)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
109. 0.567 2.331 ↑ 1.0 1 63

Hash (cost=2.64..2.64 rows=1 width=26) (actual time=0.037..0.037 rows=1 loops=63)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
110. 1.764 1.764 ↑ 1.0 1 63

Index Scan using matricula_pkey on matricula matricula_1 (cost=0.42..2.64 rows=1 width=26) (actual time=0.025..0.028 rows=1 loops=63)

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
111.          

SubPlan (for Hash Join)

112. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.66..2.67 rows=1 width=40) (never executed)

113. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.66..2.67 rows=1 width=40) (never executed)

  • Sort Key: ((((mp.ano)::text || '/'::text) || (mp.semestre)::text)) DESC, (CASE WHEN ((mp.situacaomatriculaperiodo)::text = ANY ('{AT,PR,FI,FO}'::text[])) THEN 1 ELSE 2 END), mp.codigo DESC
114. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo mp (cost=0.42..2.65 rows=1 width=40) (never executed)

  • Index Cond: (((matricula)::text = (matricula_1.matricula)::text) AND ((ano)::text = (matriculaperiodoturmadisciplina.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina.semestre)::text))
115. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.43..25.39 rows=1 width=4) (never executed)

116. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his (cost=0.43..25.39 rows=1 width=4) (never executed)

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

Limit (cost=13.17..14.29 rows=1 width=4) (never executed)

118. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_1 (cost=13.17..14.29 rows=1 width=4) (never executed)

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

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

120. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

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

Nested Loop Semi Join (cost=13.60..39.53 rows=1 width=0) (never executed)

123. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist (cost=0.43..25.23 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (historico_1.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_1.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_1.numeroagrupamentoequivalenciadisciplina))
124. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_2 (cost=13.17..14.29 rows=1 width=24) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_1.matricula)::text) AND (disciplina = hist.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_1.gradecurricularatual) AND ((hist.anohistorico)::text = (anohistorico)::text) AND ((hist.semestrehistorico)::text = (semestrehistorico)::text) AND (hist.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
125. 0.000 0.000 ↓ 0.0 0

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

126. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = hist.disciplina)
128. 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.56..1.68 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
129. 8.757 8.757 ↑ 1.0 1 63

Index Only Scan using disciplina_pkey on disciplina disciplina_1 (cost=6.43..7.20 rows=1 width=4) (actual time=0.139..0.139 rows=1 loops=63)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 5) OR (hashed SubPlan 6) OR (hashed SubPlan 7))
  • Heap Fetches: 0
130.          

SubPlan (for Index Only Scan)

131. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
132. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente (cost=0.14..1.26 rows=1 width=4) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
133. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_1 (cost=0.00..2.24 rows=1 width=4) (never executed)

  • Filter: (equivalente = 7,459)
134. 17.766 17.766 ↑ 1.0 1 63

Index Only Scan using pessoa_pkey on pessoa pessoa_1 (cost=0.42..2.64 rows=1 width=4) (actual time=0.282..0.282 rows=1 loops=63)

  • Index Cond: (codigo = matricula_1.aluno)
  • Heap Fetches: 8
135. 0.856 1.008 ↑ 1.0 1 63

Index Scan using turma_pkey on turma turma_3 (cost=277.98..280.11 rows=1 width=24) (actual time=0.015..0.016 rows=1 loops=63)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 2) OR (hashed SubPlan 3) OR (hashed SubPlan 4))
136.          

SubPlan (for Index Scan)

137. 0.152 0.152 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada (cost=0.29..30.37 rows=38 width=4) (actual time=0.037..0.152 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
138. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

139. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

140. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_1 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
141. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_1 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_1.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
142. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_2 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
143. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

144. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

145. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_2 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
146. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_2 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_2.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
147. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_3 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
148. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=286.81..2,478.77 rows=1 width=36) (never executed)

149. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=286.39..2,478.31 rows=1 width=22) (never executed)

150. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=279.96..2,471.85 rows=1 width=26) (never executed)

151. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.98..2,193.83 rows=1 width=38) (never executed)

  • Join Filter: ((((curso_2.periodicidade)::text = 'IN'::text) OR (((curso_2.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 13))) AND (((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 20))))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicocursandoporcorrespondenciaapostransferencia AND (historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_2.disciplina = (SubPlan 21)) AND ((NOT historico_2.historicoporequivalencia) OR (historico_2.historicoporequivalencia IS NULL))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicoequivalente AND (SubPlan 22)) OR ((historico_2.matrizcurricular = matriculaperiodo_2.gradecurricular) AND (matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 23)))))
152. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.56..2,122.83 rows=1 width=91) (never executed)

153. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.28..2,122.54 rows=1 width=92) (never executed)

154. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..2,122.10 rows=1 width=80) (never executed)

155. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_disciplina on historico historico_2 (cost=0.43..494.26 rows=619 width=48) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
156. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.43..2.62 rows=1 width=40) (never executed)

  • Index Cond: (codigo = historico_2.matriculaperiodoturmadisciplina)
  • Filter: ((historico_2.matricula)::text = (matricula)::text)
157. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula matricula_2 (cost=0.42..0.44 rows=1 width=26) (never executed)

  • Index Cond: ((matricula)::text = (matriculaperiodoturmadisciplina_1.matricula)::text)
158. 0.000 0.000 ↓ 0.0 0

Index Scan using curso_pkey on curso curso_2 (cost=0.28..0.29 rows=1 width=7) (never executed)

  • Index Cond: (codigo = matricula_2.curso)
159. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_2 (cost=0.42..0.45 rows=1 width=8) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
160.          

SubPlan (for Nested Loop)

161. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.66..2.67 rows=1 width=40) (never executed)

162. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.66..2.67 rows=1 width=40) (never executed)

  • Sort Key: ((((mp_1.ano)::text || '/'::text) || (mp_1.semestre)::text)) DESC, (CASE WHEN ((mp_1.situacaomatriculaperiodo)::text = ANY ('{AT,PR,FI,FO}'::text[])) THEN 1 ELSE 2 END), mp_1.codigo DESC
163. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo mp_1 (cost=0.42..2.65 rows=1 width=40) (never executed)

  • Index Cond: (((matricula)::text = (matricula_2.matricula)::text) AND ((ano)::text = (matriculaperiodoturmadisciplina_1.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_1.semestre)::text))
164. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.43..25.39 rows=1 width=4) (never executed)

165. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_4 (cost=0.43..25.39 rows=1 width=4) (never executed)

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

Limit (cost=13.17..14.29 rows=1 width=4) (never executed)

167. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_5 (cost=13.17..14.29 rows=1 width=4) (never executed)

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

BitmapAnd (cost=13.17..13.17 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..1.70 rows=22 width=0) (never executed)

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = historico_2.disciplina)
171. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.60..39.53 rows=1 width=0) (never executed)

172. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_1 (cost=0.43..25.23 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (historico_2.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_2.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_2.numeroagrupamentoequivalenciadisciplina))
173. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_6 (cost=13.17..14.29 rows=1 width=24) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_2.matricula)::text) AND (disciplina = hist_1.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_2.gradecurricularatual) AND ((hist_1.anohistorico)::text = (anohistorico)::text) AND ((hist_1.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_1.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
174. 0.000 0.000 ↓ 0.0 0

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

175. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = hist_1.disciplina)
177. 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.56..1.68 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
178. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_6 (cost=277.98..278.01 rows=1 width=24) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 14) OR (hashed SubPlan 15) OR (hashed SubPlan 16))
179.          

SubPlan (for Index Scan)

180. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_3 (cost=0.29..30.37 rows=38 width=4) (never executed)

  • Index Cond: (turmaorigem = 97,392)
181. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

182. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_4 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
184. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_4 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_4.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
185. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_4 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
186. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

187. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

188. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_5 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
189. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_5 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_5.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
190. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_5 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
191. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplina_pkey on disciplina disciplina_2 (cost=6.43..6.46 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 17) OR (hashed SubPlan 18) OR (hashed SubPlan 19))
  • Heap Fetches: 0
192.          

SubPlan (for Index Only Scan)

193. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_1 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
194. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_2 (cost=0.14..1.26 rows=1 width=4) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
195. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_3 (cost=0.00..2.24 rows=1 width=4) (never executed)

  • Filter: (equivalente = 7,459)
196. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa pessoa_2 (cost=0.42..0.46 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matricula_2.aluno)
  • Heap Fetches: 0
197. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=298.70..363.60 rows=1 width=0) (never executed)

198. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=298.28..360.96 rows=1 width=4) (never executed)

199. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=291.85..353.75 rows=1 width=8) (never executed)

200. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=13.87..73.63 rows=1 width=20) (never executed)

  • Hash Cond: (curso_3.codigo = matricula_3.curso)
  • Join Filter: ((((curso_3.periodicidade)::text = 'IN'::text) OR (((curso_3.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 25))) AND (((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 32))))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicocursandoporcorrespondenciaapostransferencia AND (historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_3.disciplina = (SubPlan 33)) AND ((NOT historico_3.historicoporequivalencia) OR (historico_3.historicoporequivalencia IS NULL))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicoequivalente AND (SubPlan 34)) OR ((historico_3.matrizcurricular = matriculaperiodo_3.gradecurricular) AND (matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 35)))))
201. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=11.22..70.98 rows=1 width=91) (never executed)

202. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=10.80..68.33 rows=1 width=87) (never executed)

203. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=10.80..14.33 rows=1 width=80) (never executed)

204. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico historico_3 (cost=10.37..11.49 rows=1 width=48) (never executed)

  • Recheck Cond: (((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text) AND (disciplina = 7,459))
  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
205. 0.000 0.000 ↓ 0.0 0

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

206. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
207. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..8.42 rows=626 width=0) (never executed)

  • Index Cond: (disciplina = 7,459)
208. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.43..2.65 rows=1 width=40) (never executed)

  • Index Cond: (codigo = historico_3.matriculaperiodoturmadisciplina)
  • Filter: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
209. 0.000 0.000 ↓ 0.0 0

Seq Scan on curso curso_3 (cost=0.00..48.00 rows=600 width=7) (never executed)

210. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_3 (cost=0.42..2.65 rows=1 width=8) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
211. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.64..2.64 rows=1 width=26) (never executed)

212. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula matricula_3 (cost=0.42..2.64 rows=1 width=26) (never executed)

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
213.          

SubPlan (for Hash Join)

214. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.66..2.67 rows=1 width=40) (never executed)

215. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.66..2.67 rows=1 width=40) (never executed)

  • Sort Key: ((((mp_2.ano)::text || '/'::text) || (mp_2.semestre)::text)) DESC, (CASE WHEN ((mp_2.situacaomatriculaperiodo)::text = ANY ('{AT,PR,FI,FO}'::text[])) THEN 1 ELSE 2 END), mp_2.codigo DESC
216. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo mp_2 (cost=0.42..2.65 rows=1 width=40) (never executed)

  • Index Cond: (((matricula)::text = (matricula_3.matricula)::text) AND ((ano)::text = (matriculaperiodoturmadisciplina_2.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_2.semestre)::text))
217. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.43..25.39 rows=1 width=4) (never executed)

218. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_8 (cost=0.43..25.39 rows=1 width=4) (never executed)

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

Limit (cost=13.17..14.29 rows=1 width=4) (never executed)

220. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_9 (cost=13.17..14.29 rows=1 width=4) (never executed)

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

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

222. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

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

Nested Loop Semi Join (cost=13.60..39.53 rows=1 width=0) (never executed)

225. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_2 (cost=0.43..25.23 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (historico_3.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_3.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_3.numeroagrupamentoequivalenciadisciplina))
226. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_10 (cost=13.17..14.29 rows=1 width=24) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_3.matricula)::text) AND (disciplina = hist_2.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_3.gradecurricularatual) AND ((hist_2.anohistorico)::text = (anohistorico)::text) AND ((hist_2.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_2.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
227. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=13.17..13.17 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..1.70 rows=22 width=0) (never executed)

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = hist_2.disciplina)
230. 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.56..1.68 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
231. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_9 (cost=277.98..280.11 rows=1 width=24) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 26) OR (hashed SubPlan 27) OR (hashed SubPlan 28))
232.          

SubPlan (for Index Scan)

233. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_6 (cost=0.29..30.37 rows=38 width=4) (never executed)

  • Index Cond: (turmaorigem = 97,392)
234. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

235. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

236. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_7 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
237. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_7 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_7.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
238. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_6 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
239. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

240. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

241. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_8 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
242. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_8 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_8.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
243. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_7 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
244. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplina_pkey on disciplina disciplina_3 (cost=6.43..7.20 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 29) OR (hashed SubPlan 30) OR (hashed SubPlan 31))
  • Heap Fetches: 0
245.          

SubPlan (for Index Only Scan)

246. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_2 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
247. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_4 (cost=0.14..1.26 rows=1 width=4) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
248. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_5 (cost=0.00..2.24 rows=1 width=4) (never executed)

  • Filter: (equivalente = 7,459)
249. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa pessoa_3 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matricula_3.aluno)
  • Heap Fetches: 0
250. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=286.81..2,478.77 rows=1 width=32) (never executed)

251. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=286.39..2,478.31 rows=1 width=18) (never executed)

252. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=279.96..2,471.85 rows=1 width=22) (never executed)

253. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.98..2,193.83 rows=1 width=34) (never executed)

  • Join Filter: ((((curso_4.periodicidade)::text = 'IN'::text) OR (((curso_4.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 37))) AND (((matricula_4.gradecurricularatual = historico_4.matrizcurricular) AND ((historico_4.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_4.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_4.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_4.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 44))))) OR ((matricula_4.gradecurricularatual <> historico_4.matrizcurricular) AND historico_4.historicocursandoporcorrespondenciaapostransferencia AND (historico_4.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_4.disciplina = (SubPlan 45)) AND ((NOT historico_4.historicoporequivalencia) OR (historico_4.historicoporequivalencia IS NULL))) OR ((matricula_4.gradecurricularatual <> historico_4.matrizcurricular) AND historico_4.historicoequivalente AND (SubPlan 46)) OR ((historico_4.matrizcurricular = matriculaperiodo_4.gradecurricular) AND (matricula_4.gradecurricularatual <> historico_4.matrizcurricular) AND historico_4.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 47)))))
254. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.56..2,122.83 rows=1 width=91) (never executed)

255. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.28..2,122.54 rows=1 width=92) (never executed)

256. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..2,122.10 rows=1 width=80) (never executed)

257. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_disciplina on historico historico_4 (cost=0.43..494.26 rows=619 width=48) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
258. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.43..2.62 rows=1 width=40) (never executed)

  • Index Cond: (codigo = historico_4.matriculaperiodoturmadisciplina)
  • Filter: ((historico_4.matricula)::text = (matricula)::text)
259. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula matricula_4 (cost=0.42..0.44 rows=1 width=26) (never executed)

  • Index Cond: ((matricula)::text = (matriculaperiodoturmadisciplina_3.matricula)::text)
260. 0.000 0.000 ↓ 0.0 0

Index Scan using curso_pkey on curso curso_4 (cost=0.28..0.29 rows=1 width=7) (never executed)

  • Index Cond: (codigo = matricula_4.curso)
261. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_4 (cost=0.42..0.45 rows=1 width=8) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
262.          

SubPlan (for Nested Loop)

263. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.66..2.67 rows=1 width=40) (never executed)

264. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.66..2.67 rows=1 width=40) (never executed)

  • Sort Key: ((((mp_3.ano)::text || '/'::text) || (mp_3.semestre)::text)) DESC, (CASE WHEN ((mp_3.situacaomatriculaperiodo)::text = ANY ('{AT,PR,FI,FO}'::text[])) THEN 1 ELSE 2 END), mp_3.codigo DESC
265. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo mp_3 (cost=0.42..2.65 rows=1 width=40) (never executed)

  • Index Cond: (((matricula)::text = (matricula_4.matricula)::text) AND ((ano)::text = (matriculaperiodoturmadisciplina_3.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_3.semestre)::text))
266. 0.000 0.000 ↓ 0.0 0

Limit (cost=0.43..25.39 rows=1 width=4) (never executed)

267. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico his_12 (cost=0.43..25.39 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = (historico_4.matricula)::text)
  • Filter: (historicocursandoporcorrespondenciaapostransferencia AND (matrizcurricular <> matricula_4.gradecurricularatual) AND ((anohistorico)::text = (historico_4.anohistorico)::text) AND ((semestrehistorico)::text = (historico_4.semestrehistorico)::text) AND (disciplina = historico_4.disciplina) AND (transferenciamatrizcurricularmatricula = historico_4.transferenciamatrizcurricularmatricula))
268. 0.000 0.000 ↓ 0.0 0

Limit (cost=13.17..14.29 rows=1 width=4) (never executed)

269. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_13 (cost=13.17..14.29 rows=1 width=4) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_4.matricula)::text) AND (disciplina = historico_4.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND ((anohistorico)::text = (historico_4.anohistorico)::text) AND ((semestrehistorico)::text = (historico_4.semestrehistorico)::text) AND (transferenciamatrizcurricularmatricula = historico_4.transferenciamatrizcurricularmatricula) AND (matrizcurricular = matricula_4.gradecurricularatual))
270. 0.000 0.000 ↓ 0.0 0

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

271. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (historico_4.matricula)::text)
272. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = historico_4.disciplina)
273. 0.000 0.000 ↓ 0.0 0

Nested Loop Semi Join (cost=13.60..39.53 rows=1 width=0) (never executed)

274. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_3 (cost=0.43..25.23 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (historico_4.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico_4.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico_4.numeroagrupamentoequivalenciadisciplina))
275. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_14 (cost=13.17..14.29 rows=1 width=24) (never executed)

  • Recheck Cond: (((matricula)::text = (historico_4.matricula)::text) AND (disciplina = hist_3.disciplina))
  • Filter: (((historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historicocursandoporcorrespondenciaapostransferencia)) AND (matrizcurricular = matricula_4.gradecurricularatual) AND ((hist_3.anohistorico)::text = (anohistorico)::text) AND ((hist_3.semestrehistorico)::text = (semestrehistorico)::text) AND (hist_3.transferenciamatrizcurricularmatricula = transferenciamatrizcurricularmatricula))
276. 0.000 0.000 ↓ 0.0 0

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

277. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (historico_4.matricula)::text)
278. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.22 rows=852 width=0) (never executed)

  • Index Cond: (disciplina = hist_3.disciplina)
279. 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.56..1.68 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico_4.disciplina) AND (matriculaperiodo = historico_4.matriculaperiodo) AND (matrizcurricular = matricula_4.gradecurricularatual))
  • Heap Fetches: 0
280. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_12 (cost=277.98..278.01 rows=1 width=24) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 38) OR (hashed SubPlan 39) OR (hashed SubPlan 40))
281.          

SubPlan (for Index Scan)

282. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_9 (cost=0.29..30.37 rows=38 width=4) (never executed)

  • Index Cond: (turmaorigem = 97,392)
283. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

284. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

285. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_10 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
286. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_10 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_10.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
287. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_8 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
288. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.86..123.61 rows=1 width=4) (never executed)

289. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.57..121.10 rows=1 width=8) (never executed)

290. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_11 (cost=0.29..30.37 rows=38 width=8) (never executed)

  • Index Cond: (turmaorigem = 97,392)
291. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turma_11 (cost=0.29..2.33 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turmaagrupada_11.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
292. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmaorigem_9 (cost=0.29..2.51 rows=1 width=4) (never executed)

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
293. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplina_pkey on disciplina disciplina_4 (cost=6.43..6.46 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 41) OR (hashed SubPlan 42) OR (hashed SubPlan 43))
  • Heap Fetches: 0
294.          

SubPlan (for Index Only Scan)

295. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_3 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
296. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_6 (cost=0.14..1.26 rows=1 width=4) (never executed)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
297. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente disciplinaequivalente_7 (cost=0.00..2.24 rows=1 width=4) (never executed)

  • Filter: (equivalente = 7,459)
298. 0.000 0.000 ↓ 0.0 0

Index Only Scan using pessoa_pkey on pessoa pessoa_4 (cost=0.42..0.46 rows=1 width=4) (never executed)

  • Index Cond: (codigo = matricula_4.aluno)
  • Heap Fetches: 0
Planning time : 718.709 ms
Execution time : 3,155.375 ms