explain.depesz.com

PostgreSQL's explain analyze made readable

Result: csQ1

Settings
# exclusive inclusive rows x rows loops node
1. 0.454 55,070.300 ↓ 65.0 65 1

Sort (cost=194,133.64..194,133.64 rows=1 width=398) (actual time=55,070.218..55,070.300 rows=65 loops=1)

  • Sort Key: t."Pessoa.nome
  • Sort Method: quicksort Memory: 58kB
2. 0.451 55,069.846 ↓ 65.0 65 1

Subquery Scan on t (cost=193,406.24..194,133.63 rows=1 width=398) (actual time=54,928.119..55,069.846 rows=65 loops=1)

  • Filter: ((alternatives: SubPlan 12 or hashed SubPlan 24) OR (NOT (alternatives: SubPlan 36 or hashed SubPlan 48)))
3. 0.495 54,918.985 ↓ 65.0 65 1

Unique (cost=193,406.24..193,406.41 rows=1 width=398) (actual time=54,918.380..54,918.985 rows=65 loops=1)

4. 0.731 54,918.490 ↓ 65.0 65 1

Sort (cost=193,406.24..193,406.24 rows=1 width=398) (actual time=54,918.376..54,918.490 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.402 54,917.759 ↓ 65.0 65 1

Nested Loop Left Join (cost=66,060.58..193,406.23 rows=1 width=398) (actual time=40,734.515..54,917.759 rows=65 loops=1)

6. 0.442 54,916.577 ↓ 65.0 65 1

Nested Loop Left Join (cost=66,060.46..193,406.07 rows=1 width=364) (actual time=40,734.044..54,916.577 rows=65 loops=1)

7. 0.416 54,915.745 ↓ 65.0 65 1

Nested Loop Left Join (cost=66,060.18..193,405.78 rows=1 width=349) (actual time=40,734.007..54,915.745 rows=65 loops=1)

8. 0.419 54,914.874 ↓ 65.0 65 1

Nested Loop Left Join (cost=66,060.04..193,405.61 rows=1 width=333) (actual time=40,733.973..54,914.874 rows=65 loops=1)

9. 0.505 54,914.130 ↓ 65.0 65 1

Nested Loop (cost=66,059.90..193,405.45 rows=1 width=318) (actual time=40,733.946..54,914.130 rows=65 loops=1)

10. 8,073.204 54,912.065 ↓ 65.0 65 1

Nested Loop (cost=66,059.48..193,404.89 rows=1 width=279) (actual time=40,733.874..54,912.065 rows=65 loops=1)

  • Join Filter: ((matriculaperiodoturmadisciplina.turma = turma.codigo) AND ((turma.codigo = 97,392) OR (hashed SubPlan 50) OR (hashed SubPlan 51) OR (hashed SubPlan 52)))
  • Rows Removed by Join Filter: 5,545,860
11. 93.164 93.164 ↑ 1.0 18,425 1

Index Scan using ch_turma_unidadeensino on turma (cost=0.29..823.89 rows=18,425 width=61) (actual time=0.020..93.164 rows=18,425 loops=1)

12. 6,990.300 46,744.225 ↓ 301.0 301 18,425

Materialize (cost=65,781.49..191,842.68 rows=1 width=218) (actual time=0.473..2.537 rows=301 loops=18,425)

13. 1.972 39,753.925 ↓ 301.0 301 1

Nested Loop (cost=65,781.49..191,842.67 rows=1 width=218) (actual time=8,688.434..39,753.925 rows=301 loops=1)

  • Join Filter: (((curso.periodicidade)::text = 'IN'::text) OR (((curso.periodicidade)::text = ANY ('{AN,SE}'::text[])) AND (SubPlan 49)))
14. 0.000 39,743.224 ↓ 301.0 301 1

Nested Loop (cost=65,781.22..191,839.70 rows=1 width=173) (actual time=8,688.403..39,743.224 rows=301 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))))
15. 93.716 39,780.346 ↓ 23.2 301 1

Gather (cost=65,780.80..190,949.46 rows=13 width=164) (actual time=8,688.336..39,780.346 rows=301 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
16. 3,004.085 39,686.630 ↓ 18.8 75 4 / 4

Nested Loop (cost=64,780.80..189,948.16 rows=4 width=164) (actual time=9,981.623..39,686.630 rows=75 loops=4)

17. 5,830.651 32,583.039 ↓ 102,487.6 512,438 4 / 4

Nested Loop (cost=64,774.37..189,915.88 rows=5 width=164) (actual time=7,546.303..32,583.039 rows=512,438 loops=4)

18. 5,015.981 17,715.282 ↓ 99,308.9 695,162 4 / 4

Parallel Hash Join (cost=64,773.95..189,912.75 rows=7 width=117) (actual time=7,541.320..17,715.282 rows=695,162 loops=4)

  • Hash Cond: (((historico.matricula)::text = (matriculaperiodoturmadisciplina.matricula)::text) AND (historico.matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina.codigo))
19. 5,166.931 5,166.931 ↑ 1.3 708,152 4 / 4

Parallel Seq Scan on historico (cost=0.00..120,324.31 rows=917,046 width=56) (actual time=0.050..5,166.931 rows=708,152 loops=4)

  • Filter: ((situacao)::text <> ALL ('{AA,CC,CH,IS}'::text[]))
  • Rows Removed by Filter: 8,434
20. 2,714.003 7,532.370 ↑ 1.3 697,359 4 / 4

Parallel Hash (cost=51,276.98..51,276.98 rows=899,798 width=65) (actual time=7,532.369..7,532.370 rows=697,359 loops=4)

  • Buckets: 4,194,304 Batches: 1 Memory Usage: 299,648kB
21. 4,818.367 4,818.367 ↑ 1.3 697,359 4 / 4

Parallel Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..51,276.98 rows=899,798 width=65) (actual time=0.022..4,818.367 rows=697,359 loops=4)

22. 9,037.106 9,037.106 ↑ 1.0 1 2,780,648 / 4

Index Scan using matriculaperiodo_pkey on matriculaperiodo (cost=0.42..0.45 rows=1 width=47) (actual time=0.013..0.013 rows=1 loops=2,780,648)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
  • Rows Removed by Filter: 0
23. 4,084.296 4,099.506 ↓ 0.0 0 2,049,753 / 4

Index Only Scan using disciplina_pkey on disciplina (cost=6.43..6.46 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=2,049,753)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 53) OR (hashed SubPlan 54) OR (hashed SubPlan 55))
  • Rows Removed by Filter: 1
  • Heap Fetches: 0
24.          

SubPlan (for Index Only Scan)

25. 15.137 15.137 ↑ 1.0 1 4 / 4

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

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

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

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

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

  • Filter: (equivalente = 7,459)
  • Rows Removed by Filter: 99
28. 7.224 7.224 ↑ 1.0 1 301

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

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

SubPlan (for Nested Loop)

30. 0.000 0.000 ↓ 0.0 0

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

31. 0.000 0.000 ↓ 0.0 0

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

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

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

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

35. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

38. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (historico.matricula)::text)
  • Filter: (historicoporequivalencia AND (historico.mapaequivalenciadisciplina = mapaequivalenciadisciplina) AND (numeroagrupamentoequivalenciadisciplina = historico.numeroagrupamentoequivalenciadisciplina))
39. 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))
40. 0.000 0.000 ↓ 0.0 0

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

41. 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)
42. 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)
43. 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
44. 8.729 8.729 ↑ 1.0 1 301

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

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

SubPlan (for Nested Loop)

46. 0.000 0.000 ↓ 0.0 0

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

47. 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
48. 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 = (matriculaperiodoturmadisciplina.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina.semestre)::text))
49.          

SubPlan (for Nested Loop)

50. 0.169 0.169 ↓ 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.062..0.169 rows=50 loops=1)

  • Index Cond: (turmaorigem = 97,392)
51. 0.003 0.706 ↓ 0.0 0 1

Nested Loop (cost=0.86..123.61 rows=1 width=4) (actual time=0.705..0.706 rows=0 loops=1)

52. 0.187 0.703 ↓ 0.0 0 1

Nested Loop (cost=0.57..121.10 rows=1 width=8) (actual time=0.702..0.703 rows=0 loops=1)

53. 0.116 0.116 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_13 (cost=0.29..30.37 rows=38 width=8) (actual time=0.018..0.116 rows=50 loops=1)

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

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

  • Index Cond: (codigo = turmaagrupada_13.turma)
  • Filter: ((tiposubturma)::text = 'PRATICA'::text)
  • Rows Removed by Filter: 1
55. 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)
56. 0.002 0.597 ↓ 0.0 0 1

Nested Loop (cost=0.86..123.61 rows=1 width=4) (actual time=0.596..0.597 rows=0 loops=1)

57. 0.178 0.595 ↓ 0.0 0 1

Nested Loop (cost=0.57..121.10 rows=1 width=8) (actual time=0.594..0.595 rows=0 loops=1)

58. 0.117 0.117 ↓ 1.3 50 1

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_14 (cost=0.29..30.37 rows=38 width=8) (actual time=0.018..0.117 rows=50 loops=1)

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

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

  • Index Cond: (codigo = turmaagrupada_14.turma)
  • Filter: ((tiposubturma)::text = 'TEORICA'::text)
  • Rows Removed by Filter: 1
60. 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)
61. 1.560 1.560 ↑ 1.0 1 65

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

  • Index Cond: (codigo = matricula.aluno)
62. 0.325 0.325 ↑ 1.0 1 65

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

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

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

  • Index Cond: (turma.unidadeensino = codigo)
64. 0.390 0.390 ↑ 1.0 1 65

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

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

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

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

SubPlan (for Subquery Scan)

67. 0.260 150.410 ↑ 1.0 1 65

Result (cost=298.71..363.61 rows=1 width=0) (actual time=2.314..2.314 rows=1 loops=65)

  • One-Time Filter: (t."MatriculaPeriodoTurmaDisciplina.disciplina" = 7,459)
68. 0.455 150.150 ↑ 1.0 1 65

Nested Loop (cost=298.71..363.61 rows=1 width=0) (actual time=2.310..2.310 rows=1 loops=65)

69. 0.325 148.785 ↑ 1.0 1 65

Nested Loop (cost=20.73..83.48 rows=1 width=12) (actual time=2.289..2.289 rows=1 loops=65)

70. 0.715 147.810 ↑ 1.0 1 65

Nested Loop (cost=20.31..80.84 rows=1 width=16) (actual time=2.274..2.274 rows=1 loops=65)

71. 8.970 146.640 ↑ 1.0 1 65

Hash Join (cost=13.88..73.64 rows=1 width=20) (actual time=2.256..2.256 rows=1 loops=65)

  • 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)))))
72. 31.384 135.720 ↓ 84.0 84 65

Nested Loop (cost=11.23..70.99 rows=1 width=91) (actual time=0.678..2.088 rows=84 loops=65)

73. 20.865 71.630 ↓ 84.0 84 65

Nested Loop (cost=10.81..68.34 rows=1 width=87) (actual time=0.659..1.102 rows=84 loops=65)

74. 0.780 41.990 ↑ 1.0 1 65

Nested Loop (cost=10.81..14.34 rows=1 width=80) (actual time=0.646..0.646 rows=1 loops=65)

75. 1.300 34.515 ↑ 1.0 1 65

Bitmap Heap Scan on historico historico_1 (cost=10.38..11.50 rows=1 width=48) (actual time=0.531..0.531 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
76. 0.455 33.215 ↓ 0.0 0 65

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

77. 27.430 27.430 ↑ 1.8 12 65

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

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

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

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

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

  • Index Cond: (codigo = historico_1.matriculaperiodoturmadisciplina)
  • Filter: ((matricula)::text = (t."MatriculaPeriodoTurmaDisciplina.matricula")::text)
80. 8.775 8.775 ↑ 7.1 84 65

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

81. 32.706 32.706 ↑ 1.0 1 5,451

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

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
82. 0.455 1.950 ↑ 1.0 1 65

Hash (cost=2.64..2.64 rows=1 width=26) (actual time=0.030..0.030 rows=1 loops=65)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
83. 1.495 1.495 ↑ 1.0 1 65

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

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

SubPlan (for Hash Join)

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.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
87. 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_1.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_1.semestre)::text))
88. 0.000 0.000 ↓ 0.0 0

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

89. 0.000 0.000 ↓ 0.0 0

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

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

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

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

93. 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)
94. 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)
95. 0.000 0.000 ↓ 0.0 0

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

96. 0.000 0.000 ↓ 0.0 0

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

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

99. 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)
100. 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)
101. 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
102. 0.455 0.455 ↑ 1.0 1 65

Index Only Scan using disciplina_pkey on disciplina disciplina_1 (cost=6.43..7.20 rows=1 width=4) (actual time=0.007..0.007 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
103.          

SubPlan (for Index Only Scan)

104. 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))
105. 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
106. 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)
107. 0.650 0.650 ↑ 1.0 1 65

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

  • Index Cond: (codigo = matricula_1.aluno)
  • Heap Fetches: 8
108. 0.805 0.910 ↑ 1.0 1 65

Index Scan using turma_pkey on turma turma_3 (cost=277.98..280.11 rows=1 width=24) (actual time=0.014..0.014 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))
109.          

SubPlan (for Index Scan)

110. 0.105 0.105 ↓ 1.3 50 1

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

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

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

112. 0.000 0.000 ↓ 0.0 0

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

113. 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)
114. 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)
115. 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)
116. 0.000 0.000 ↓ 0.0 0

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

117. 0.000 0.000 ↓ 0.0 0

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

118. 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)
119. 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)
120. 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)
121. 0.000 0.000 ↓ 0.0 0

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

122. 0.000 0.000 ↓ 0.0 0

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

123. 0.000 0.000 ↓ 0.0 0

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

124. 0.000 0.000 ↓ 0.0 0

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

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

126. 0.000 0.000 ↓ 0.0 0

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

127. 0.000 0.000 ↓ 0.0 0

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

128. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (codigo = historico_2.matriculaperiodoturmadisciplina)
  • Filter: ((historico_2.matricula)::text = (matricula)::text)
130. 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_2.matricula)::text)
131. 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)
132. 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_2.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
133.          

SubPlan (for Nested Loop)

134. 0.000 0.000 ↓ 0.0 0

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

135. 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
136. 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_2.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_2.semestre)::text))
137. 0.000 0.000 ↓ 0.0 0

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

138. 0.000 0.000 ↓ 0.0 0

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

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

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

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

142. 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)
143. 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)
144. 0.000 0.000 ↓ 0.0 0

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

145. 0.000 0.000 ↓ 0.0 0

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

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

148. 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)
149. 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)
150. 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
151. 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_2.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 14) OR (hashed SubPlan 15) OR (hashed SubPlan 16))
152.          

SubPlan (for Index Scan)

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

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

155. 0.000 0.000 ↓ 0.0 0

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

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

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

160. 0.000 0.000 ↓ 0.0 0

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

161. 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)
162. 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)
163. 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)
164. 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_2.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 17) OR (hashed SubPlan 18) OR (hashed SubPlan 19))
  • Heap Fetches: 0
165.          

SubPlan (for Index Only Scan)

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

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

171. 0.000 0.000 ↓ 0.0 0

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

172. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=291.86..353.76 rows=1 width=8) (never executed)

173. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=13.88..73.64 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)))))
174. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=11.23..70.99 rows=1 width=91) (never executed)

175. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=10.81..68.34 rows=1 width=87) (never executed)

176. 0.000 0.000 ↓ 0.0 0

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

177. 0.000 0.000 ↓ 0.0 0

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

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

179. 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)
180. 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)
181. 0.000 0.000 ↓ 0.0 0

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

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

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

183. 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_3.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
184. 0.000 0.000 ↓ 0.0 0

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

185. 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)
186.          

SubPlan (for Hash Join)

187. 0.000 0.000 ↓ 0.0 0

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

188. 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
189. 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_3.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_3.semestre)::text))
190. 0.000 0.000 ↓ 0.0 0

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

191. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

198. 0.000 0.000 ↓ 0.0 0

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

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

201. 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)
202. 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)
203. 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
204. 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_3.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 26) OR (hashed SubPlan 27) OR (hashed SubPlan 28))
205.          

SubPlan (for Index Scan)

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

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

208. 0.000 0.000 ↓ 0.0 0

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

209. 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)
210. 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)
211. 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)
212. 0.000 0.000 ↓ 0.0 0

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

213. 0.000 0.000 ↓ 0.0 0

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

214. 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)
215. 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)
216. 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)
217. 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_3.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 29) OR (hashed SubPlan 30) OR (hashed SubPlan 31))
  • Heap Fetches: 0
218.          

SubPlan (for Index Only Scan)

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

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

224. 0.000 0.000 ↓ 0.0 0

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

225. 0.000 0.000 ↓ 0.0 0

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

226. 0.000 0.000 ↓ 0.0 0

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

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

228. 0.000 0.000 ↓ 0.0 0

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

229. 0.000 0.000 ↓ 0.0 0

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

230. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (codigo = historico_4.matriculaperiodoturmadisciplina)
  • Filter: ((historico_4.matricula)::text = (matricula)::text)
232. 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_4.matricula)::text)
233. 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)
234. 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_4.matriculaperiodo)
  • Filter: (((situacaomatriculaperiodo)::text = ANY ('{AT,FO,FI}'::text[])) AND ((situacao)::text = ANY ('{PF,CO,AT}'::text[])))
235.          

SubPlan (for Nested Loop)

236. 0.000 0.000 ↓ 0.0 0

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

237. 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
238. 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_4.ano)::text) AND ((semestre)::text = (matriculaperiodoturmadisciplina_4.semestre)::text))
239. 0.000 0.000 ↓ 0.0 0

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

240. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

247. 0.000 0.000 ↓ 0.0 0

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

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

250. 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)
251. 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)
252. 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
253. 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_4.turma)
  • Filter: ((codigo = 97,392) OR (hashed SubPlan 38) OR (hashed SubPlan 39) OR (hashed SubPlan 40))
254.          

SubPlan (for Index Scan)

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

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

257. 0.000 0.000 ↓ 0.0 0

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

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

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

262. 0.000 0.000 ↓ 0.0 0

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

263. 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)
264. 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)
265. 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)
266. 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_4.disciplina)
  • Filter: ((codigo = 7,459) OR (hashed SubPlan 41) OR (hashed SubPlan 42) OR (hashed SubPlan 43))
  • Heap Fetches: 0
267.          

SubPlan (for Index Only Scan)

268. 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))
269. 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
270. 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)
271. 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 : 180.706 ms
Execution time : 55,123.805 ms