explain.depesz.com

PostgreSQL's explain analyze made readable

Result: d6xR

Settings
# exclusive inclusive rows x rows loops node
1. 1.188 8,746.141 ↓ 65.0 65 1

Sort (cost=425,817.93..425,817.94 rows=1 width=398) (actual time=8,746.061..8,746.141 rows=65 loops=1)

  • Sort Key: t."Pessoa.nome
  • Sort Method: quicksort Memory: 58kB
2. 0.334 8,744.953 ↓ 65.0 65 1

Subquery Scan on t (cost=425,006.31..425,817.92 rows=1 width=398) (actual time=8,718.705..8,744.953 rows=65 loops=1)

  • Filter: ((alternatives: SubPlan 12 or hashed SubPlan 24) OR (NOT (alternatives: SubPlan 36 or hashed SubPlan 48)))
3. 2.761 8,720.959 ↓ 65.0 65 1

Unique (cost=425,006.31..425,006.48 rows=1 width=398) (actual time=8,718.107..8,720.959 rows=65 loops=1)

4. 0.579 8,718.198 ↓ 65.0 65 1

Sort (cost=425,006.31..425,006.31 rows=1 width=398) (actual time=8,718.103..8,718.198 rows=65 loops=1)

  • Sort Key: matriculaperiodoturmadisciplina.matricula, matriculaperiodoturmadisciplina.turma, matriculaperiodoturmadisciplina.turmateorica, matriculaperiodoturmadisciplina.turmapratica, matriculaperiodoturmadisciplina.permiteescolhermodalidade, matriculaperiodoturmadisciplina.conteudo, matriculaperiodoturmadisciplina.modalidadedisciplina, matriculaperiodoturmadisciplina.matriculaperiodo, matriculaperiodoturmadisciplina.semestre, matriculaperiodoturmadisciplina.ano, matriculaperiodoturmadisciplina.codigo, matriculaperiodoturmadisciplina.disciplina, matriculaperiodoturmadisciplina.disciplinaincluida, matriculaperiodoturmadisciplina.disciplinaequivale, matriculaperiodoturmadisciplina.disciplinaequivalente, matriculaperiodoturmadisciplina.disciplinafazpartecomposicao, matriculaperiodoturmadisciplina.justificativa, matriculaperiodoturmadisciplina.observacaojustificativa, matriculaperiodoturmadisciplina.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: 58kB
5. 0.473 8,717.619 ↓ 65.0 65 1

Nested Loop Left Join (cost=213,452.49..425,006.30 rows=1 width=398) (actual time=4,893.849..8,717.619 rows=65 loops=1)

6. 0.466 8,716.821 ↓ 65.0 65 1

Nested Loop Left Join (cost=213,452.37..425,005.96 rows=1 width=364) (actual time=4,893.824..8,716.821 rows=65 loops=1)

7. 0.431 8,715.900 ↓ 65.0 65 1

Nested Loop Left Join (cost=213,452.09..425,005.58 rows=1 width=349) (actual time=4,893.793..8,715.900 rows=65 loops=1)

8. 0.495 8,715.144 ↓ 65.0 65 1

Nested Loop Left Join (cost=213,451.95..425,005.32 rows=1 width=334) (actual time=4,893.767..8,715.144 rows=65 loops=1)

9. 0.461 8,714.259 ↓ 65.0 65 1

Nested Loop (cost=213,451.81..425,005.06 rows=1 width=318) (actual time=4,893.747..8,714.259 rows=65 loops=1)

10. 0.490 8,713.083 ↓ 65.0 65 1

Nested Loop (cost=213,451.39..425,004.41 rows=1 width=279) (actual time=4,893.719..8,713.083 rows=65 loops=1)

  • Join Filter: (((curso.periodicidade)::text = 'IN'::text) OR (((curso.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 49)))
11. 0.000 8,712.138 ↓ 65.0 65 1

Nested Loop (cost=213,451.11..425,001.16 rows=1 width=234) (actual time=4,893.693..8,712.138 rows=65 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 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. 70.144 8,743.287 ↓ 5.4 65 1

Gather (cost=213,450.69..424,140.01 rows=12 width=225) (actual time=4,893.640..8,743.287 rows=65 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
13. 1,372.864 8,673.143 ↓ 4.0 16 4 / 4

Parallel Hash Join (cost=212,450.69..423,138.81 rows=4 width=225) (actual time=5,419.809..8,673.143 rows=16 loops=4)

  • Hash Cond: (((historico.matricula)::text = (matriculaperiodoturmadisciplina.matricula)::text) AND (historico.matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina.codigo))
14. 2,529.410 2,529.410 ↑ 1.3 708,170 4 / 4

Parallel Seq Scan on historico (cost=0.00..203,810.17 rows=917,046 width=56) (actual time=0.021..2,529.410 rows=708,170 loops=4)

  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
  • Rows Removed by Filter: 8,434
15. 0.647 4,770.869 ↑ 30,094.1 16 4 / 4

Parallel Hash (cost=161,892.56..161,892.56 rows=481,506 width=173) (actual time=4,770.868..4,770.869 rows=16 loops=4)

  • Buckets: 2,097,152 Batches: 1 Memory Usage: 16,512kB
16. 0.414 4,770.222 ↑ 30,094.1 16 4 / 4

Hash Join (cost=24,164.14..161,892.56 rows=481,506 width=173) (actual time=703.726..4,770.222 rows=16 loops=4)

  • Hash Cond: (matriculaperiodoturmadisciplina.disciplina = disciplina.codigo)
17. 1,147.628 4,767.833 ↑ 2,866.2 192 4 / 4

Hash Join (cost=22,766.61..159,042.16 rows=550,316 width=173) (actual time=305.942..4,767.833 rows=192 loops=4)

  • Hash Cond: (matriculaperiodoturmadisciplina.turma = turma.codigo)
  • Join Filter: ((turma.codigo = 97,392) OR (hashed SubPlan 50) OR (hashed SubPlan 51) OR (hashed SubPlan 52))
  • Rows Removed by Join Filter: 514,294
18. 2,293.695 3,539.628 ↑ 1.2 514,486 4 / 4

Parallel Hash Join (cost=18,315.21..152,936.50 rows=628,927 width=112) (actual time=153.029..3,539.628 rows=514,486 loops=4)

  • Hash Cond: (matriculaperiodoturmadisciplina.matriculaperiodo = matriculaperiodo.codigo)
19. 1,093.725 1,093.725 ↑ 1.3 697,376 4 / 4

Parallel Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..132,258.81 rows=899,798 width=65) (actual time=0.023..1,093.725 rows=697,376 loops=4)

20. 64.532 152.208 ↑ 1.7 31,120 4 / 4

Parallel Hash (cost=13,002.95..13,002.95 rows=51,827 width=47) (actual time=152.207..152.208 rows=31,120 loops=4)

  • Buckets: 131,072 Batches: 1 Memory Usage: 11,840kB
21. 87.676 87.676 ↑ 1.7 31,120 4 / 4

Parallel Seq Scan on matriculaperiodo (cost=0.00..13,002.95 rows=51,827 width=47) (actual time=0.024..87.676 rows=31,120 loops=4)

  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
  • Rows Removed by Filter: 13,393
22. 38.812 79.253 ↑ 1.0 18,425 4 / 4

Hash (cost=2,267.50..2,267.50 rows=18,425 width=61) (actual time=79.251..79.253 rows=18,425 loops=4)

  • Buckets: 32,768 Batches: 1 Memory Usage: 2,054kB
23. 40.441 40.441 ↑ 1.0 18,425 4 / 4

Seq Scan on turma (cost=0.00..2,267.50 rows=18,425 width=61) (actual time=0.027..40.441 rows=18,425 loops=4)

24.          

SubPlan (for Hash Join)

25. 0.173 0.173 ↓ 1.3 50 4 / 4

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_12 (cost=0.29..33.79 rows=38 width=4) (actual time=0.078..0.173 rows=50 loops=4)

  • Index Cond: (turmaorigem = 97,392)
26. 0.002 0.628 ↓ 0.0 0 4 / 4

Nested Loop (cost=0.86..130.72 rows=1 width=4) (actual time=0.627..0.628 rows=0 loops=4)

27. 0.225 0.626 ↓ 0.0 0 4 / 4

Nested Loop (cost=0.57..128.03 rows=1 width=8) (actual time=0.625..0.626 rows=0 loops=4)

28. 0.101 0.101 ↓ 1.3 50 4 / 4

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_13 (cost=0.29..33.79 rows=38 width=8) (actual time=0.017..0.101 rows=50 loops=4)

  • Index Cond: (turmaorigem = 97,392)
29. 0.300 0.300 ↓ 0.0 0 200 / 4

Index Scan using turma_pkey on turma turma_13 (cost=0.29..2.42 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=200)

  • Index Cond: (codigo = turmaagrupada_13.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
  • Rows Removed by Filter: 1
30. 0.000 0.000 ↓ 0.0 0 / 4

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

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
31. 0.002 0.523 ↓ 0.0 0 4 / 4

Nested Loop (cost=0.86..130.72 rows=1 width=4) (actual time=0.522..0.523 rows=0 loops=4)

32. 0.174 0.521 ↓ 0.0 0 4 / 4

Nested Loop (cost=0.57..128.03 rows=1 width=8) (actual time=0.520..0.521 rows=0 loops=4)

33. 0.097 0.097 ↓ 1.3 50 4 / 4

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_14 (cost=0.29..33.79 rows=38 width=8) (actual time=0.014..0.097 rows=50 loops=4)

  • Index Cond: (turmaorigem = 97,392)
34. 0.250 0.250 ↓ 0.0 0 200 / 4

Index Scan using turma_pkey on turma turma_14 (cost=0.29..2.42 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=200)

  • Index Cond: (codigo = turmaagrupada_14.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
  • Rows Removed by Filter: 1
35. 0.000 0.000 ↓ 0.0 0 / 4

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

  • Index Cond: (codigo = 97,392)
  • Filter: (NOT subturma)
36. 0.010 1.975 ↑ 5,843.0 1 4 / 4

Hash (cost=798.62..798.62 rows=5,843 width=4) (actual time=1.974..1.975 rows=1 loops=4)

  • Buckets: 8,192 Batches: 1 Memory Usage: 65kB
37. 1.821 1.965 ↑ 5,843.0 1 4 / 4

Index Only Scan using disciplina_pkey on disciplina (cost=7.55..798.62 rows=5,843 width=4) (actual time=1.802..1.965 rows=1 loops=4)

  • 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
38.          

SubPlan (for Index Only Scan)

39. 0.082 0.082 ↑ 1.0 1 4 / 4

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_4 (cost=0.42..2.73 rows=1 width=4) (actual time=0.079..0.082 rows=1 loops=4)

  • Index Cond: ((turma = 97,392) AND (disciplina = 7,459))
40. 0.045 0.045 ↓ 0.0 0 4 / 4

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_8 (cost=0.14..1.35 rows=1 width=4) (actual time=0.044..0.045 rows=0 loops=4)

  • Index Cond: (disciplina = 7,459)
  • Heap Fetches: 0
41. 0.017 0.017 ↓ 0.0 0 4 / 4

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente disciplinaequivalente_9 (cost=0.14..3.19 rows=1 width=4) (actual time=0.016..0.017 rows=0 loops=4)

  • Index Cond: (equivalente = 7,459)
  • Heap Fetches: 0
42. 1.300 1.300 ↑ 1.0 1 65

Index Scan using matricula_pkey on matricula (cost=0.42..0.53 rows=1 width=53) (actual time=0.020..0.020 rows=1 loops=65)

  • Index Cond: ((matricula)::text = (matriculaperiodoturmadisciplina.matricula)::text)
43.          

SubPlan (for Nested Loop)

44. 0.000 0.000 ↓ 0.0 0

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

45. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_16 (cost=13.17..14.38 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))
46. 0.000 0.000 ↓ 0.0 0

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

47. 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)
48. 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)
49. 0.000 0.000 ↓ 0.0 0

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

50. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_17 (cost=13.17..14.38 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))
51. 0.000 0.000 ↓ 0.0 0

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

52. 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)
53. 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)
54. 0.000 0.000 ↓ 0.0 0

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

55. 0.000 0.000 ↓ 0.0 0

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

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

Bitmap Heap Scan on historico his_18 (cost=13.17..14.38 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))
57. 0.000 0.000 ↓ 0.0 0

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

58. 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)
59. 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)
60. 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.77 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = historico.disciplina) AND (matriculaperiodo = historico.matriculaperiodo) AND (matrizcurricular = matricula.gradecurricularatual))
  • Heap Fetches: 0
61. 0.455 0.455 ↑ 1.0 1 65

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

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

SubPlan (for Nested Loop)

63. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.75..2.76 rows=1 width=40) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.75..2.76 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
65. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (((matricula)::text = (matricula.matricula)::text) AND ((ano)::text = (matriculaperiodoturmadisciplina.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina.semestre)::text))
66. 0.715 0.715 ↑ 1.0 1 65

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

  • Index Cond: (codigo = matricula.aluno)
67. 0.390 0.390 ↑ 1.0 1 65

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

  • Index Cond: (turma.unidadeensino = codigo)
68. 0.325 0.325 ↑ 1.0 1 65

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

  • Index Cond: (turma.turno = codigo)
69. 0.455 0.455 ↑ 1.0 1 65

Index Scan using periodoletivo_pkey on periodoletivo (cost=0.28..0.39 rows=1 width=19) (actual time=0.007..0.007 rows=1 loops=65)

  • Index Cond: (turma.periodoletivo = codigo)
70. 0.325 0.325 ↑ 1.0 1 65

Index Scan using pk_chancela_codigo on chancela (cost=0.12..0.23 rows=1 width=9) (actual time=0.005..0.005 rows=1 loops=65)

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

SubPlan (for Subquery Scan)

72. 0.260 23.660 ↑ 1.0 1 65

Result (cost=315.53..405.67 rows=1 width=0) (actual time=0.364..0.364 rows=1 loops=65)

  • One-Time Filter: (t."MatriculaPeriodoTurmaDisciplina.disciplina" = 7,459)
73. 0.325 23.400 ↑ 1.0 1 65

Nested Loop (cost=315.53..405.67 rows=1 width=0) (actual time=0.360..0.360 rows=1 loops=65)

74. 0.715 17.485 ↑ 1.0 1 65

Nested Loop (cost=19.90..107.73 rows=1 width=12) (actual time=0.269..0.269 rows=1 loops=65)

75. 2.470 16.315 ↑ 1.0 1 65

Nested Loop (cost=19.48..105.00 rows=1 width=16) (actual time=0.251..0.251 rows=1 loops=65)

76. 1.040 13.585 ↑ 1.0 1 65

Nested Loop (cost=11.92..96.58 rows=1 width=20) (actual time=0.209..0.209 rows=1 loops=65)

  • 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)))))
77. 0.455 2.925 ↑ 1.0 1 65

Nested Loop (cost=0.70..5.32 rows=1 width=25) (actual time=0.045..0.045 rows=1 loops=65)

78. 2.145 2.145 ↑ 1.0 1 65

Index Scan using matricula_pkey on matricula matricula_1 (cost=0.42..2.73 rows=1 width=26) (actual time=0.033..0.033 rows=1 loops=65)

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
79. 0.325 0.325 ↑ 1.0 1 65

Index Scan using curso_pkey on curso curso_1 (cost=0.28..2.58 rows=1 width=7) (actual time=0.005..0.005 rows=1 loops=65)

  • Index Cond: (codigo = matricula_1.curso)
80. 1.365 9.620 ↑ 1.0 1 65

Nested Loop (cost=11.23..17.26 rows=1 width=84) (actual time=0.148..0.148 rows=1 loops=65)

81. 0.975 6.630 ↑ 1.0 1 65

Nested Loop (cost=10.81..14.53 rows=1 width=80) (actual time=0.101..0.102 rows=1 loops=65)

82. 0.585 5.070 ↑ 1.0 1 65

Bitmap Heap Scan on historico historico_1 (cost=10.38..11.59 rows=1 width=48) (actual time=0.078..0.078 rows=1 loops=65)

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

BitmapAnd (cost=10.38..10.38 rows=1 width=0) (actual time=0.069..0.069 rows=0 loops=65)

84. 0.910 0.910 ↑ 1.8 12 65

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

  • Index Cond: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
85. 3.120 3.120 ↑ 1.4 460 65

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..8.43 rows=627 width=0) (actual time=0.048..0.048 rows=460 loops=65)

  • Index Cond: (disciplina = 7,459)
86. 0.585 0.585 ↑ 1.0 1 65

Index Scan using matriculaperiodoturmadisciplina_pkey on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.43..2.74 rows=1 width=40) (actual time=0.009..0.009 rows=1 loops=65)

  • Index Cond: (codigo = historico_1.matriculaperiodoturmadisciplina)
  • Filter: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
87. 1.625 1.625 ↑ 1.0 1 65

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_1 (cost=0.42..2.74 rows=1 width=8) (actual time=0.025..0.025 rows=1 loops=65)

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

SubPlan (for Nested Loop)

89. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.75..2.76 rows=1 width=40) (never executed)

90. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.75..2.76 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
91. 0.000 0.000 ↓ 0.0 0

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

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

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

93. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his (cost=13.17..14.38 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))
94. 0.000 0.000 ↓ 0.0 0

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

95. 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)
96. 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)
97. 0.000 0.000 ↓ 0.0 0

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

98. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_1 (cost=13.17..14.38 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))
99. 0.000 0.000 ↓ 0.0 0

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

100. 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)
101. 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)
102. 0.000 0.000 ↓ 0.0 0

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

103. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist (cost=0.43..27.32 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))
104. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_2 (cost=13.17..14.38 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))
105. 0.000 0.000 ↓ 0.0 0

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

106. 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)
107. 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)
108. 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.77 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
109. 0.260 0.260 ↑ 1.0 1 65

Index Only Scan using disciplina_pkey on disciplina disciplina_1 (cost=7.55..8.42 rows=1 width=4) (actual time=0.004..0.004 rows=1 loops=65)

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

SubPlan (for Index Only Scan)

111. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

  • Index Cond: (equivalente = 7,459)
  • Heap Fetches: 0
114. 0.455 0.455 ↑ 1.0 1 65

Index Only Scan using pessoa_pkey on pessoa pessoa_1 (cost=0.42..2.73 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=65)

  • Index Cond: (codigo = matricula_1.aluno)
  • Heap Fetches: 9
115. 5.493 5.590 ↑ 1.0 1 65

Index Scan using turma_pkey on turma turma_3 (cost=295.62..297.84 rows=1 width=24) (actual time=0.086..0.086 rows=1 loops=65)

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

SubPlan (for Index Scan)

117. 0.097 0.097 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada (cost=0.29..33.79 rows=38 width=4) (actual time=0.012..0.097 rows=50 loops=1)

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

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

119. 0.000 0.000 ↓ 0.0 0

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

120. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

124. 0.000 0.000 ↓ 0.0 0

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

125. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

Nested Loop (cost=305.58..2,677.45 rows=1 width=36) (never executed)

129. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=305.15..2,676.89 rows=1 width=22) (never executed)

130. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=297.60..2,669.22 rows=1 width=26) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.98..2,373.38 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)))))
132. 0.000 0.000 ↓ 0.0 0

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

133. 0.000 0.000 ↓ 0.0 0

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

134. 0.000 0.000 ↓ 0.0 0

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

135. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

  • Index Cond: ((matricula)::text = (matriculaperiodoturmadisciplina_2.matricula)::text)
138. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_2 (cost=0.42..0.54 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[])))
140.          

SubPlan (for Nested Loop)

141. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.75..2.76 rows=1 width=40) (never executed)

142. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.75..2.76 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
143. 0.000 0.000 ↓ 0.0 0

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

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

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

145. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_4 (cost=13.17..14.38 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))
146. 0.000 0.000 ↓ 0.0 0

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

147. 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)
148. 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)
149. 0.000 0.000 ↓ 0.0 0

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

150. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_5 (cost=13.17..14.38 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))
151. 0.000 0.000 ↓ 0.0 0

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

152. 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)
153. 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)
154. 0.000 0.000 ↓ 0.0 0

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

155. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_1 (cost=0.43..27.32 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))
156. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_6 (cost=13.17..14.38 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))
157. 0.000 0.000 ↓ 0.0 0

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

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

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

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

SubPlan (for Index Scan)

163. 0.000 0.000 ↓ 0.0 0

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

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

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

165. 0.000 0.000 ↓ 0.0 0

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

166. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

170. 0.000 0.000 ↓ 0.0 0

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

171. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

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

SubPlan (for Index Only Scan)

176. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

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

Nested Loop (cost=315.52..405.67 rows=1 width=0) (never executed)

181. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=315.10..402.94 rows=1 width=4) (never executed)

182. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=307.55..394.52 rows=1 width=8) (never executed)

183. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=11.92..96.58 rows=1 width=20) (never executed)

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

Nested Loop (cost=0.70..5.32 rows=1 width=25) (never executed)

185. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (codigo = matricula_3.curso)
187. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=11.23..17.26 rows=1 width=84) (never executed)

188. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=10.81..14.53 rows=1 width=80) (never executed)

189. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico historico_3 (cost=10.38..11.59 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[]))
190. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_3 (cost=0.42..2.74 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[])))
195.          

SubPlan (for Nested Loop)

196. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.75..2.76 rows=1 width=40) (never executed)

197. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.75..2.76 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
198. 0.000 0.000 ↓ 0.0 0

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

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

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

200. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_8 (cost=13.17..14.38 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))
201. 0.000 0.000 ↓ 0.0 0

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

202. 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)
203. 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)
204. 0.000 0.000 ↓ 0.0 0

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

205. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_9 (cost=13.17..14.38 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))
206. 0.000 0.000 ↓ 0.0 0

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

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

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

210. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_2 (cost=0.43..27.32 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))
211. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_10 (cost=13.17..14.38 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))
212. 0.000 0.000 ↓ 0.0 0

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

213. 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)
214. 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)
215. 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.77 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
216. 0.000 0.000 ↓ 0.0 0

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

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

SubPlan (for Index Scan)

218. 0.000 0.000 ↓ 0.0 0

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

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

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

220. 0.000 0.000 ↓ 0.0 0

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

221. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

225. 0.000 0.000 ↓ 0.0 0

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

226. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

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

SubPlan (for Index Only Scan)

231. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

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

Nested Loop (cost=305.58..2,677.45 rows=1 width=32) (never executed)

236. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=305.15..2,676.89 rows=1 width=18) (never executed)

237. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=297.60..2,669.22 rows=1 width=22) (never executed)

238. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.98..2,373.38 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)))))
239. 0.000 0.000 ↓ 0.0 0

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

240. 0.000 0.000 ↓ 0.0 0

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

241. 0.000 0.000 ↓ 0.0 0

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

242. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

  • Index Cond: ((matricula)::text = (matriculaperiodoturmadisciplina_4.matricula)::text)
245. 0.000 0.000 ↓ 0.0 0

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

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

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

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

SubPlan (for Nested Loop)

248. 0.000 0.000 ↓ 0.0 0

Limit (cost=2.75..2.76 rows=1 width=40) (never executed)

249. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.75..2.76 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
250. 0.000 0.000 ↓ 0.0 0

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

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

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

252. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

257. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_13 (cost=13.17..14.38 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))
258. 0.000 0.000 ↓ 0.0 0

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

259. 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)
260. 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)
261. 0.000 0.000 ↓ 0.0 0

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

262. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_historico_matricula on historico hist_3 (cost=0.43..27.32 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))
263. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_14 (cost=13.17..14.38 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))
264. 0.000 0.000 ↓ 0.0 0

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

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

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

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

SubPlan (for Index Scan)

270. 0.000 0.000 ↓ 0.0 0

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

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

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

272. 0.000 0.000 ↓ 0.0 0

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

273. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

277. 0.000 0.000 ↓ 0.0 0

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

278. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

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

SubPlan (for Index Only Scan)

283. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

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

  • Index Cond: (codigo = matricula_4.aluno)
  • Heap Fetches: 0
Planning time : 125.589 ms
Execution time : 8,782.039 ms