explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LKms

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,104,300.63..3,104,311.75 rows=1,112 width=134) (actual rows= loops=)

  • Group Key: "*SELECT* 1".cpf, "*SELECT* 1".curso_codigo, "*SELECT* 1".curso_codigoorigem, "*SELECT* 1".codigosituacao, "*SELECT* 1".situacaomatricula, "*SELECT* 1".turma_codigo, "*SELECT* 1".modulo_codigo, (("*SELECT* 1".vinculo_inicio)::timestamp with time zone), "*SELECT* 1".data_confirmacao, (("*SELECT* 1".vinculo_fim)::timestamp with time zone), "*SELECT* 1".codigo_reposicao
  • Group Key: "*SELECT* 1".cpf, "*SELECT* 1".curso_codigo, "*SELECT* 1".curso_codigoorigem, "*SELECT* 1".codigosituacao, "*SELECT* 1".situacaomatricula, "*SELECT* 1".turma_codigo, "*SELECT* 1".modulo_codigo, (("*SELECT* 1".vinculo_inicio)::timestamp with time zone), "*SELECT* 1".data_confirmacao, (("*SELECT* 1".vinculo_fim)::timestamp with time zone), "*SELECT* 1".codigo_reposicao
2. 0.000 0.000 ↓ 0.0

Append (cost=3,101,810.19..3,104,270.05 rows=1,112 width=134) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,101,810.19..3,101,826.85 rows=1,111 width=134) (actual rows= loops=)

  • Group Key: "*SELECT* 1".cpf, "*SELECT* 1".curso_codigo, "*SELECT* 1".curso_codigoorigem, "*SELECT* 1".codigosituacao, "*SELECT* 1".situacaomatricula, "*SELECT* 1".turma_codigo, "*SELECT* 1".modulo_codigo, "*SELECT* 1".vinculo_inicio, "*SELECT* 1".data_confirmacao, "*SELECT* 1".vinculo_fim, "*SELECT* 1".codigo_reposicao
4. 0.000 0.000 ↓ 0.0

Append (cost=1,232,482.94..3,101,779.64 rows=1,111 width=130) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=1,232,482.94..1,232,518.82 rows=261 width=90) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,232,482.94..1,232,516.21 rows=261 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento.data, matricula.data, matricula.situacao, aluno.cpf, cursorep.codigo, matricula.curso, turma.codigo, disciplina.codigo, matriculaperiodoturmadisciplina.turma, matriculaperiodo.turma
7. 0.000 0.000 ↓ 0.0

Sort (cost=1,232,482.94..1,232,483.59 rows=261 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento.data, matricula.data, matricula.situacao, aluno.cpf, cursorep.codigo, matricula.curso, turma.codigo, disciplina.codigo, matriculaperiodoturmadisciplina.turma, matriculaperiodo.turma
8. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,948.06..1,232,472.46 rows=261 width=61) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,947.63..1,232,350.73 rows=261 width=57) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,947.20..1,232,122.41 rows=261 width=57) (actual rows= loops=)

  • Join Filter: ((contareceber.matriculaaluno)::text = (matricula.matricula)::text)
11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=18,946.77..1,231,808.89 rows=261 width=71) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Hash Join (cost=18,946.35..1,231,661.32 rows=261 width=61) (actual rows= loops=)

  • Hash Cond: (turmarep.curso = cursorep.codigo)
13. 0.000 0.000 ↓ 0.0

Nested Loop (cost=18,924.04..1,231,638.33 rows=261 width=61) (actual rows= loops=)

14. 0.000 0.000 ↓ 0.0

Hash Join (cost=18,923.76..1,231,558.64 rows=261 width=57) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina.matriculaperiodo = matriculaperiodo.codigo)
  • Join Filter: (CASE WHEN ((curso.niveleducacional)::text = 'SU'::text) THEN ((((matricula.situacao)::text = 'AT'::text) AND ((matriculaperiodo.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END AND (((matricula.gradecurricularatual = historico.matrizcurricular) AND ((historico.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico.transferenciamatrizcurricularmatricula IS NULL) OR ((historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 4))))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicocursandoporcorrespondenciaapostransferencia AND (historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico.disciplina = (SubPlan 5)) AND ((NOT historico.historicoporequivalencia) OR (historico.historicoporequivalencia IS NULL))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicoequivalente AND (SubPlan 6)) OR ((historico.matrizcurricular = matriculaperiodo.gradecurricular) AND (matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 7)))))
15. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9,815.27..1,222,271.89 rows=67,915 width=104) (actual rows= loops=)

16. 0.000 0.000 ↓ 0.0

Hash Join (cost=9,814.84..1,189,022.05 rows=65,973 width=64) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodoturmadisciplina.matricula)::text = (matricula.matricula)::text)
17. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,179.78..1,180,213.81 rows=65,973 width=41) (actual rows= loops=)

18. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,175.52..336,774.18 rows=65,973 width=43) (actual rows= loops=)

  • Hash Cond: (horarioturma.turma = turma.codigo)
  • Join Filter: (((matriculaperiodoturmadisciplina.disciplina = disciplina.codigo) OR (turma.turmaagrupada AND (SubPlan 2))) AND ((matriculaperiodoturmadisciplina.turma = turma.codigo) OR (SubPlan 3)))
19. 0.000 0.000 ↓ 0.0

Hash Join (cost=47.46..292,233.59 rows=16,513,208 width=42) (actual rows= loops=)

  • Hash Cond: (((matriculaperiodoturmadisciplina.ano)::text = (horarioturma.anovigente)::text) AND ((matriculaperiodoturmadisciplina.semestre)::text = (horarioturma.semestrevigente)::text))
20. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..70,537.35 rows=2,825,835 width=32) (actual rows= loops=)

21. 0.000 0.000 ↓ 0.0

Hash (cost=47.35..47.35 rows=7 width=14) (actual rows= loops=)

22. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.83..47.35 rows=7 width=14) (actual rows= loops=)

23. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.41..36.56 rows=7 width=18) (actual rows= loops=)

24. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..27.86 rows=7 width=18) (actual rows= loops=)

25. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..25.77 rows=7 width=16) (actual rows= loops=)

26. 0.000 0.000 ↓ 0.0

Index Scan using idx_horarioturmadiaitem_dataultimaalteracao on horarioturmadiaitem (cost=0.43..7.31 rows=7 width=16) (actual rows= loops=)

  • Index Cond: (dataultimaalteracao >= (now() - '01:00:00'::interval))
27. 0.000 0.000 ↓ 0.0

Index Scan using horarioturmadia_pkey on horarioturmadia (cost=0.42..2.64 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.horarioturmadia)
28. 0.000 0.000 ↓ 0.0

Index Scan using horarioturma_pkey on horarioturma (cost=0.28..0.30 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadia.horarioturma)
29. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina (cost=0.28..1.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.disciplina)
30. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor (cost=0.42..1.54 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.professor)
31. 0.000 0.000 ↓ 0.0

Hash (cost=891.36..891.36 rows=18,936 width=9) (actual rows= loops=)

32. 0.000 0.000 ↓ 0.0

Seq Scan on turma (cost=0.00..891.36 rows=18,936 width=9) (actual rows= loops=)

33.          

SubPlan (for Hash Join)

34. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de.disciplina
35. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

36. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = disciplina.codigo)
37. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina.codigo)
38. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_3 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma.codigo)
39. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma.curso) OR (codigo = (SubPlan 1)))
  • Filter: (((NOT turma.turmaagrupada) AND (codigo = turma.curso)) OR (turma.turmaagrupada AND (codigo = (SubPlan 1))))
40. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

41. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma.curso)
42. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 1))
43.          

SubPlan (for Bitmap Heap Scan)

44. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

45. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

46. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_2 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma.codigo)
47. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_2.turma)
48. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=37) (actual rows= loops=)

49. 0.000 0.000 ↓ 0.0

Seq Scan on matricula (cost=0.00..6,421.14 rows=177,114 width=37) (actual rows= loops=)

50. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina.codigo)
51. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=15) (actual rows= loops=)

52. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo (cost=0.00..6,843.77 rows=181,177 width=15) (actual rows= loops=)

53.          

SubPlan (for Hash Join)

54. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

55. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

57. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_1 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

59. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

62. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_2 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

65. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist.disciplina)
67. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico.disciplina) AND (matriculaperiodo = historico.matriculaperiodo) AND (matrizcurricular = matricula.gradecurricularatual))
68. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.turma)
69. 0.000 0.000 ↓ 0.0

Hash (cost=14.79..14.79 rows=601 width=4) (actual rows= loops=)

70. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep (cost=0.28..14.79 rows=601 width=4) (actual rows= loops=)

71. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula.aluno)
72. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
73. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber.codigo)
74. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento.negociacaorecebimento = codigo)
75. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=1,556,343.87..1,556,392.27 rows=352 width=90) (actual rows= loops=)

76. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,556,343.87..1,556,388.75 rows=352 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_1.data, matricula_1.data, matricula_1.situacao, aluno_1.cpf, cursorep_1.codigo, matricula_1.curso, turma_1.codigo, disciplina_1.codigo, matriculaperiodoturmadisciplina_1.turma, matriculaperiodo_1.turma
77. 0.000 0.000 ↓ 0.0

Sort (cost=1,556,343.87..1,556,344.75 rows=352 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_1.data, matricula_1.data, matricula_1.situacao, aluno_1.cpf, cursorep_1.codigo, matricula_1.curso, turma_1.codigo, disciplina_1.codigo, matriculaperiodoturmadisciplina_1.turma, matriculaperiodo_1.turma
78. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,521.65..1,556,328.98 rows=352 width=61) (actual rows= loops=)

79. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,521.22..1,556,164.81 rows=352 width=57) (actual rows= loops=)

80. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,520.79..1,555,856.88 rows=352 width=57) (actual rows= loops=)

  • Join Filter: (contareceber_1.matriculaperiodo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
81. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,378,520.36..1,554,975.37 rows=352 width=71) (actual rows= loops=)

82. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,378,519.94..1,554,776.35 rows=352 width=61) (actual rows= loops=)

  • Hash Cond: (turmarep_1.curso = cursorep_1.codigo)
83. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,378,497.64..1,554,753.12 rows=352 width=61) (actual rows= loops=)

84. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,378,497.35..1,554,010.45 rows=352 width=57) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodoturmadisciplina_1.matricula)::text = (matricula_1.matricula)::text)
  • Join Filter: (CASE WHEN ((curso_1.niveleducacional)::text = 'SU'::text) THEN ((((matricula_1.situacao)::text = 'AT'::text) AND ((matriculaperiodo_1.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_1.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END 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 11))))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicocursandoporcorrespondenciaapostransferencia AND (historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_1.disciplina = (SubPlan 12)) AND ((NOT historico_1.historicoporequivalencia) OR (historico_1.historicoporequivalencia IS NULL))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicoequivalente AND (SubPlan 13)) OR ((historico_1.matrizcurricular = matriculaperiodo_1.gradecurricular) AND (matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 14)))))
85. 0.000 0.000 ↓ 0.0

Merge Join (cost=1,369,862.28..1,545,134.83 rows=91,637 width=92) (actual rows= loops=)

  • Merge Cond: (historico_1.matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_1.codigo)
86. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_1 (cost=0.43..171,551.13 rows=2,909,008 width=48) (actual rows= loops=)

87. 0.000 0.000 ↓ 0.0

Sort (cost=1,369,861.80..1,370,084.35 rows=89,017 width=52) (actual rows= loops=)

  • Sort Key: matriculaperiodoturmadisciplina_1.codigo
88. 0.000 0.000 ↓ 0.0

Hash Join (cost=40,105.81..1,362,543.81 rows=89,017 width=52) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina_1.matriculaperiodo = matriculaperiodo_1.codigo)
89. 0.000 0.000 ↓ 0.0

Hash Join (cost=30,997.33..1,353,201.66 rows=89,017 width=41) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.professor = professor_1.codigo)
90. 0.000 0.000 ↓ 0.0

Nested Loop (cost=12,192.38..1,334,163.03 rows=89,017 width=45) (actual rows= loops=)

91. 0.000 0.000 ↓ 0.0

Hash Join (cost=12,188.12..178,126.71 rows=90,424 width=47) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.disciplina = disciplina_1.codigo)
  • Join Filter: ((matriculaperiodoturmadisciplina_1.disciplina = disciplina_1.codigo) OR (turma_1.turmaagrupada AND (SubPlan 9)))
92. 0.000 0.000 ↓ 0.0

Hash Join (cost=11,980.02..148,164.01 rows=11,317,242 width=51) (actual rows= loops=)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
93. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,208.33..13,413.54 rows=263,223 width=16) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.horarioturmadia = horarioturmadia_1.codigo)
94. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=0.00..7,514.23 rows=263,223 width=16) (actual rows= loops=)

95. 0.000 0.000 ↓ 0.0

Hash (cost=3,121.48..3,121.48 rows=166,948 width=8) (actual rows= loops=)

96. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadia horarioturmadia_1 (cost=0.00..3,121.48 rows=166,948 width=8) (actual rows= loops=)

97. 0.000 0.000 ↓ 0.0

Hash (cost=4,871.31..4,871.31 rows=152,030 width=43) (actual rows= loops=)

98. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,128.78..4,871.31 rows=152,030 width=43) (actual rows= loops=)

  • Hash Cond: (horarioturma_1.turma = turma_1.codigo)
  • Join Filter: ((matriculaperiodoturmadisciplina_1.turma = turma_1.codigo) OR (SubPlan 10))
99. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..2,799.57 rows=304,044 width=38) (actual rows= loops=)

100. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodoturmadisciplina_dataultimaalteracao on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.43..113.95 rows=103 width=32) (actual rows= loops=)

  • Index Cond: (dataultimaalteracao >= (now() - '01:00:00'::interval))
101. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_semestre on horarioturma horarioturma_1 (cost=0.28..24.39 rows=168 width=10) (actual rows= loops=)

  • Index Cond: ((semestrevigente)::text = (matriculaperiodoturmadisciplina_1.semestre)::text)
  • Filter: ((matriculaperiodoturmadisciplina_1.ano)::text = (anovigente)::text)
102. 0.000 0.000 ↓ 0.0

Hash (cost=891.36..891.36 rows=18,936 width=9) (actual rows= loops=)

103. 0.000 0.000 ↓ 0.0

Seq Scan on turma turma_1 (cost=0.00..891.36 rows=18,936 width=9) (actual rows= loops=)

104.          

SubPlan (for Hash Join)

105. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_5 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_1.codigo)
106. 0.000 0.000 ↓ 0.0

Hash (cost=124.14..124.14 rows=6,717 width=4) (actual rows= loops=)

107. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_1 (cost=0.28..124.14 rows=6,717 width=4) (actual rows= loops=)

108.          

SubPlan (for Hash Join)

109. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de_1.disciplina
110. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

111. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de_1 (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = disciplina_1.codigo)
112. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2_1 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina_1.codigo)
113. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_1 (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma_1.curso) OR (codigo = (SubPlan 8)))
  • Filter: (((NOT turma_1.turmaagrupada) AND (codigo = turma_1.curso)) OR (turma_1.turmaagrupada AND (codigo = (SubPlan 8))))
114. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

115. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma_1.curso)
116. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 8))
117.          

SubPlan (for Bitmap Heap Scan)

118. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

119. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

120. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_4 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_1.codigo)
121. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_1 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_4.turma)
122. 0.000 0.000 ↓ 0.0

Hash (cost=12,179.44..12,179.44 rows=530,041 width=4) (actual rows= loops=)

123. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_1 (cost=0.42..12,179.44 rows=530,041 width=4) (actual rows= loops=)

124. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=15) (actual rows= loops=)

125. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo matriculaperiodo_1 (cost=0.00..6,843.77 rows=181,177 width=15) (actual rows= loops=)

126. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=37) (actual rows= loops=)

127. 0.000 0.000 ↓ 0.0

Seq Scan on matricula matricula_1 (cost=0.00..6,421.14 rows=177,114 width=37) (actual rows= loops=)

128.          

SubPlan (for Hash Join)

129. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

130. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_4 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

132. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_5 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

134. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

137. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_1 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_6 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

140. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_1.disciplina)
142. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_1.disciplina) AND (matriculaperiodo = historico_1.matriculaperiodo) AND (matrizcurricular = matricula_1.gradecurricularatual))
143. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep_1 (cost=0.29..2.11 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.turma)
144. 0.000 0.000 ↓ 0.0

Hash (cost=14.79..14.79 rows=601 width=4) (actual rows= loops=)

145. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep_1 (cost=0.28..14.79 rows=601 width=4) (actual rows= loops=)

146. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_1 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_1.aluno)
147. 0.000 0.000 ↓ 0.0

Index Scan using ch_contareceber_matriculaaluno on contareceber contareceber_1 (cost=0.43..2.49 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((matriculaaluno)::text = (matricula_1.matricula)::text)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
148. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_1 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_1.codigo)
149. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_1 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_1.negociacaorecebimento = codigo)
150. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=237,579.20..237,647.40 rows=496 width=90) (actual rows= loops=)

151. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=237,579.20..237,642.44 rows=496 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_2.data, matricula_2.data, matricula_2.situacao, aluno_2.cpf, curso_2.codigo, matricula_2.curso, turma_2.codigo, disciplina_2.codigo, matriculaperiodoturmadisciplina_2.turma, matriculaperiodo_2.turma
152. 0.000 0.000 ↓ 0.0

Sort (cost=237,579.20..237,580.44 rows=496 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_2.data, matricula_2.data, matricula_2.situacao, aluno_2.cpf, curso_2.codigo, matricula_2.curso, turma_2.codigo, disciplina_2.codigo, matriculaperiodoturmadisciplina_2.turma, matriculaperiodo_2.turma
153. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.89..237,556.99 rows=496 width=61) (actual rows= loops=)

154. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.46..237,325.65 rows=496 width=57) (actual rows= loops=)

155. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.03..236,891.76 rows=496 width=57) (actual rows= loops=)

  • Join Filter: ((contareceber_2.matriculaaluno)::text = (matricula_2.matricula)::text)
156. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,812.60..235,689.89 rows=496 width=71) (actual rows= loops=)

157. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,812.18..234,379.21 rows=496 width=61) (actual rows= loops=)

158. 0.000 0.000 ↓ 0.0

Hash Join (cost=10,811.75..234,151.76 rows=496 width=65) (actual rows= loops=)

  • Hash Cond: (horarioturmadia_2.codigo = horarioturmadiaitem_2.horarioturmadia)
  • Join Filter: ((horarioturmadiaitem_2.disciplina = matriculaperiodoturmadisciplina_2.disciplina) OR (turma_2.turmaagrupada AND (SubPlan 17)))
159. 0.000 0.000 ↓ 0.0

Nested Loop (cost=7.23..28,283.18 rows=34,324 width=66) (actual rows= loops=)

160. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6.81..26,474.29 rows=727 width=66) (actual rows= loops=)

  • Join Filter: CASE WHEN ((curso_2.niveleducacional)::text = 'SU'::text) THEN ((((matricula_2.situacao)::text = 'AT'::text) AND ((matriculaperiodo_2.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_2.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END
161. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.56..7,580.20 rows=1,476 width=69) (actual rows= loops=)

162. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.27..6,750.76 rows=1,476 width=64) (actual rows= loops=)

163. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.99..6,477.40 rows=1 width=58) (actual rows= loops=)

164. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.70..6,477.10 rows=1 width=54) (actual rows= loops=)

  • Join Filter: (((matricula_2.gradecurricularatual = historico_2.matrizcurricular) AND ((historico_2.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_2.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_2.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 18))))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicocursandoporcorrespondenciaapostransferencia AND (historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_2.disciplina = (SubPlan 19)) AND ((NOT historico_2.historicoporequivalencia) OR (historico_2.historicoporequivalencia IS NULL))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicoequivalente AND (SubPlan 20)) OR ((historico_2.matrizcurricular = matriculaperiodo_2.gradecurricular) AND (matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 21))))
165. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..32.35 rows=94 width=66) (actual rows= loops=)

166. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..24.09 rows=6 width=52) (actual rows= loops=)

167. 0.000 0.000 ↓ 0.0

Index Scan using idx_updated_updated on matricula matricula_2 (cost=0.42..8.21 rows=6 width=37) (actual rows= loops=)

  • Index Cond: (updated >= (now() - '01:00:00'::interval))
168. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo matriculaperiodo_2 (cost=0.42..2.64 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matricula_2.matricula)::text)
169. 0.000 0.000 ↓ 0.0

Index Scan using ch_matriculaperiodoturmadisciplina_matriculaperiodo on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.43..1.16 rows=22 width=18) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_2.codigo)
170. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_2 (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_2.codigo)
171.          

SubPlan (for Nested Loop)

172. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

173. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_8 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

175. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_9 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

177. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

180. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_2 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_10 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

183. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_2.disciplina)
185. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_2.disciplina) AND (matriculaperiodo = historico_2.matriculaperiodo) AND (matrizcurricular = matricula_2.gradecurricularatual))
186. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_2 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.disciplina)
187. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma horarioturma_2 (cost=0.28..272.52 rows=84 width=10) (actual rows= loops=)

  • Index Cond: (((anovigente)::text = (matriculaperiodoturmadisciplina_2.ano)::text) AND ((semestrevigente)::text = (matriculaperiodoturmadisciplina_2.semestre)::text))
  • Filter: ((turma = matriculaperiodoturmadisciplina_2.turma) OR (SubPlan 15))
188.          

SubPlan (for Index Scan)

189. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_6 (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = matriculaperiodoturmadisciplina_2.turma)
190. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turma_2 (cost=0.29..0.56 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = horarioturma_2.turma)
191. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_2 (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma_2.curso) OR (codigo = (SubPlan 16)))
  • Filter: (((NOT turma_2.turmaagrupada) AND (codigo = turma_2.curso)) OR (turma_2.turmaagrupada AND (codigo = (SubPlan 16))))
192. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

193. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma_2.curso)
194. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 16))
195.          

SubPlan (for Bitmap Heap Scan)

196. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

197. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

198. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_7 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_2.codigo)
199. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_2 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_7.turma)
200. 0.000 0.000 ↓ 0.0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_2 (cost=0.42..1.96 rows=53 width=8) (actual rows= loops=)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
201. 0.000 0.000 ↓ 0.0

Hash (cost=7,514.23..7,514.23 rows=263,223 width=16) (actual rows= loops=)

202. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadiaitem horarioturmadiaitem_2 (cost=0.00..7,514.23 rows=263,223 width=16) (actual rows= loops=)

203.          

SubPlan (for Hash Join)

204. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de_2.disciplina
205. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

206. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de_2 (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = horarioturmadiaitem_2.disciplina)
207. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2_2 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = horarioturmadiaitem_2.disciplina)
208. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_2 (cost=0.42..0.46 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem_2.professor)
209. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_2 (cost=0.42..2.64 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_2.aluno)
210. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_2 (cost=0.43..2.41 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_2.codigo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
211. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_2 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_2.codigo)
212. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_2 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_2.negociacaorecebimento = codigo)
213. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 4 (cost=154.11..154.24 rows=1 width=90) (actual rows= loops=)

214. 0.000 0.000 ↓ 0.0

Group (cost=154.11..154.23 rows=1 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_3.data, matricula_3.data, matricula_3.situacao, aluno_3.cpf, cursorep_2.codigo, matricula_3.curso, turma_3.codigo, disciplina_3.codigo, matriculaperiodoturmadisciplina_3.turma, matriculaperiodo_3.turma
215. 0.000 0.000 ↓ 0.0

Sort (cost=154.11..154.12 rows=1 width=57) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_3.data, matricula_3.data, matricula_3.situacao, aluno_3.cpf, cursorep_2.codigo, matricula_3.curso, turma_3.codigo, disciplina_3.codigo
216. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=45.23..154.10 rows=1 width=57) (actual rows= loops=)

217. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=44.80..153.63 rows=1 width=53) (actual rows= loops=)

218. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=44.37..152.76 rows=1 width=53) (actual rows= loops=)

  • Join Filter: ((contareceber_3.matriculaaluno)::text = (matricula_3.matricula)::text)
219. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.94..151.56 rows=1 width=67) (actual rows= loops=)

  • Join Filter: (((matricula_3.gradecurricularatual = historico_3.matrizcurricular) AND ((historico_3.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_3.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_3.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 22))))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicocursandoporcorrespondenciaapostransferencia AND (historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_3.disciplina = (SubPlan 23)) AND ((NOT historico_3.historicoporequivalencia) OR (historico_3.historicoporequivalencia IS NULL))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicoequivalente AND (SubPlan 24)) OR ((historico_3.matrizcurricular = matriculaperiodo_3.gradecurricular) AND (matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 25))))
220. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.51..83.00 rows=1 width=79) (actual rows= loops=)

221. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.08..80.35 rows=1 width=69) (actual rows= loops=)

222. 0.000 0.000 ↓ 0.0

Nested Loop (cost=42.66..79.01 rows=1 width=73) (actual rows= loops=)

223. 0.000 0.000 ↓ 0.0

Nested Loop (cost=42.38..78.72 rows=1 width=73) (actual rows= loops=)

  • Join Filter: (turma_3.codigo = turmarep_2.codigo)
224. 0.000 0.000 ↓ 0.0

Hash Join (cost=42.10..78.40 rows=1 width=77) (actual rows= loops=)

  • Hash Cond: (programacaotutoriaonlineprofessor.programacaotutoriaonline = programacaotutoriaonline.codigo)
225. 0.000 0.000 ↓ 0.0

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..29.94 rows=1,694 width=8) (actual rows= loops=)

226. 0.000 0.000 ↓ 0.0

Hash (cost=42.08..42.08 rows=1 width=77) (actual rows= loops=)

227. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.82..42.08 rows=1 width=77) (actual rows= loops=)

  • Join Filter: (disciplina_3.codigo = programacaotutoriaonline.disciplina)
228. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.54..29.81 rows=1 width=77) (actual rows= loops=)

  • Join Filter: ((turma_3.codigo = turmadisciplina.turma) AND (disciplina_3.codigo = turmadisciplina.disciplina))
229. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.12..29.35 rows=1 width=69) (actual rows= loops=)

230. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.84..29.05 rows=1 width=65) (actual rows= loops=)

  • Join Filter: (turma_3.codigo = matriculaperiodoturmadisciplina_3.turma)
231. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.41..27.83 rows=1 width=53) (actual rows= loops=)

  • Join Filter: CASE WHEN ((curso_3.niveleducacional)::text = 'SU'::text) THEN ((matriculaperiodo_3.situacaomatriculaperiodo)::text = 'AT'::text) ELSE true END
232. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..25.95 rows=6 width=60) (actual rows= loops=)

233. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..24.09 rows=6 width=52) (actual rows= loops=)

234. 0.000 0.000 ↓ 0.0

Index Scan using idx_updated_updated on matricula matricula_3 (cost=0.42..8.21 rows=6 width=37) (actual rows= loops=)

  • Index Cond: (updated >= (now() - '01:00:00'::interval))
235. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo matriculaperiodo_3 (cost=0.42..2.64 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matricula_3.matricula)::text)
236. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turma_3 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodo_3.turma)
237. 0.000 0.000 ↓ 0.0

Index Scan using curso_pkey on curso curso_3 (cost=0.28..0.30 rows=1 width=7) (actual rows= loops=)

  • Index Cond: (codigo = turma_3.curso)
  • Filter: ((modalidadecurso)::text = 'HIBRIDO'::text)
238. 0.000 0.000 ↓ 0.0

Index Scan using ch_matriculaperiodoturmadisciplina_matriculaperiodo on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.43..1.21 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_3.codigo)
  • Filter: (matriculaperiodo_3.turma = turma)
239. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_3 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.disciplina)
240. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina (cost=0.42..0.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((turma = matriculaperiodoturmadisciplina_3.turma) AND (disciplina = matriculaperiodoturmadisciplina_3.disciplina))
  • Filter: ((definicoestutoriaonline)::text = 'DINAMICA'::text)
241. 0.000 0.000 ↓ 0.0

Index Scan using unique_programacaotutoriaonline on programacaotutoriaonline (cost=0.28..12.25 rows=2 width=12) (actual rows= loops=)

  • Index Cond: (turma = turma_3.codigo)
  • Filter: definirperiodoaulaonline
242. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep_2 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.turma)
243. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep_2 (cost=0.28..0.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = turmarep_2.curso)
244. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_3 (cost=0.42..1.34 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = programacaotutoriaonlineprofessor.professor)
245. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_3 (cost=0.42..2.64 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_3.aluno)
246. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_3 (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_3.codigo)
247.          

SubPlan (for Nested Loop)

248. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

249. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_12 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

251. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_13 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

253. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

256. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_3 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_14 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

259. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_3.disciplina)
261. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_3.disciplina) AND (matriculaperiodo = historico_3.matriculaperiodo) AND (matrizcurricular = matricula_3.gradecurricularatual))
262. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_3 (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina_3.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
263. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_3 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_3.codigo)
264. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_3 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_3.negociacaorecebimento = codigo)
265. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 5 (cost=17,889.44..75,061.34 rows=1 width=90) (actual rows= loops=)

266. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,889.44..75,061.33 rows=1 width=86) (actual rows= loops=)

267. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,889.01..75,060.78 rows=1 width=61) (actual rows= loops=)

268. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,888.58..75,059.90 rows=1 width=61) (actual rows= loops=)

  • Join Filter: ((contareceber_4.matriculaaluno)::text = (matricula_4.matricula)::text)
269. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,888.15..75,058.70 rows=1 width=75) (actual rows= loops=)

  • Join Filter: ((((curso_4.modalidadecurso)::text = 'ON_LINE'::text) OR ((matriculaperiodoturmadisciplina_4.modalidadedisciplina)::text = 'ON_LINE'::text)) AND CASE WHEN ((curso_4.niveleducacional)::text = 'SU'::text) THEN ((((matricula_4.situacao)::text = 'AT'::text) AND ((matriculaperiodo_4.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_4.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END)
270. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,881.69..75,042.64 rows=1 width=89) (actual rows= loops=)

271. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,881.27..75,042.07 rows=1 width=79) (actual rows= loops=)

  • Join Filter: (programacaotutoriaonline_1.turma = "*SELECT* 1_1".codigo)
272. 0.000 0.000 ↓ 0.0

Hash Join (cost=17,880.98..74,692.70 rows=46 width=74) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodo_4.matricula)::text = (matricula_4.matricula)::text)
  • Join Filter: ((matriculaperiodoturmadisciplina_4.dataultimaalteracao >= (now() - '01:00:00'::interval)) OR (matricula_4.updated >= (now() - '01:00:00'::interval)))
273. 0.000 0.000 ↓ 0.0

Hash Join (cost=9,245.92..64,298.43 rows=670,173 width=63) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina_4.matriculaperiodo = matriculaperiodo_4.codigo)
274. 0.000 0.000 ↓ 0.0

Nested Loop (cost=137.43..53,430.70 rows=670,173 width=42) (actual rows= loops=)

275. 0.000 0.000 ↓ 0.0

Merge Join (cost=137.00..280.15 rows=1,593 width=20) (actual rows= loops=)

  • Merge Cond: (disciplina_4.codigo = programacaotutoriaonline_1.disciplina)
276. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_4 (cost=0.28..124.14 rows=6,717 width=4) (actual rows= loops=)

277. 0.000 0.000 ↓ 0.0

Sort (cost=136.66..140.64 rows=1,593 width=16) (actual rows= loops=)

  • Sort Key: programacaotutoriaonline_1.disciplina
278. 0.000 0.000 ↓ 0.0

Seq Scan on programacaotutoriaonline programacaotutoriaonline_1 (cost=0.00..51.93 rows=1,593 width=16) (actual rows= loops=)

279. 0.000 0.000 ↓ 0.0

Index Scan using unique_matriculaperiodoturmadisciplina_disc_matriculaperi_turma on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_4 (cost=0.43..25.52 rows=785 width=30) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina_4.codigo)
280. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=25) (actual rows= loops=)

281. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo matriculaperiodo_4 (cost=0.00..6,843.77 rows=181,177 width=25) (actual rows= loops=)

282. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=41) (actual rows= loops=)

283. 0.000 0.000 ↓ 0.0

Seq Scan on matricula matricula_4 (cost=0.00..6,421.14 rows=177,114 width=41) (actual rows= loops=)

284. 0.000 0.000 ↓ 0.0

Append (cost=0.29..7.57 rows=2 width=9) (actual rows= loops=)

285. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=0.29..2.52 rows=1 width=9) (actual rows= loops=)

286. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmanormal (cost=0.29..2.51 rows=1 width=1,735) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_4.turma)
  • Filter: ((NOT turmaagrupada) AND ((NOT turmaagrupada) OR turmaagrupada))
287. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_1 (cost=2.79..5.05 rows=1 width=9) (actual rows= loops=)

288. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.79..5.04 rows=1 width=1,735) (actual rows= loops=)

289. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.50..2.51 rows=1 width=4) (actual rows= loops=)

  • Group Key: turmaagrupada.turmaorigem
290. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = matriculaperiodoturmadisciplina_4.turma)
291. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma agrupada (cost=0.29..2.51 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada.turmaorigem)
  • Filter: (turmaagrupada AND ((NOT turmaagrupada) OR turmaagrupada))
292. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_4 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_4.aluno)
293. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_4 (cost=6.46..16.03 rows=1 width=17) (actual rows= loops=)

  • Recheck Cond: ((codigo = "*SELECT* 1_1".curso) OR (codigo = (SubPlan 26)))
  • Filter: (((NOT "*SELECT* 1_1".turmaagrupada) AND (codigo = "*SELECT* 1_1".curso)) OR ("*SELECT* 1_1".turmaagrupada AND (codigo = (SubPlan 26))))
294. 0.000 0.000 ↓ 0.0

BitmapOr (cost=6.46..6.46 rows=2 width=0) (actual rows= loops=)

295. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..1.38 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = "*SELECT* 1_1".curso)
296. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..5.08 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 26))
297.          

SubPlan (for Bitmap Heap Scan)

298. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

299. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

300. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_8 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = "*SELECT* 1_1".codigo)
301. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_3 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_8.turma)
302. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_4 (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina_4.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
303. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_4 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_4.codigo)
304. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_4 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_4.negociacaorecebimento = codigo)
305. 0.000 0.000 ↓ 0.0

Unique (cost=2,437.60..2,437.62 rows=1 width=94) (actual rows= loops=)

306. 0.000 0.000 ↓ 0.0

Sort (cost=2,437.60..2,437.60 rows=1 width=94) (actual rows= loops=)

  • Sort Key: aluno_5.cpf, curso_5.codigo, matricula_5.curso, (CASE WHEN ((matricula_5.situacao)::text = 'AC'::text) THEN 1 ELSE CASE WHEN ((matricula_5.situacao)::text = 'PR'::text) THEN 2 ELSE CASE WHEN ((matricula_5.situacao)::text = 'DE'::text) THEN 3 ELSE CASE WHEN ((matricula_5.situacao)::text = 'IN'::text) THEN 4 ELSE CASE WHEN ((matricula_5.situacao)::text = 'AT'::text) THEN 5 ELSE CASE WHEN ((matricula_5.situacao)::text = 'CA'::text) THEN 6 ELSE CASE WHEN ((matricula_5.situacao)::text = 'CF'::text) THEN 7 ELSE CASE WHEN ((matricula_5.situacao)::text = 'JU'::text) THEN 8 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TS'::text) THEN 9 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TR'::text) THEN 10 ELSE CASE WHEN ((matricula_5.situacao)::text = 'FI'::text) THEN 11 ELSE CASE WHEN ((matricula_5.situacao)::text = 'PF'::text) THEN 12 ELSE CASE WHEN ((matricula_5.situacao)::text = 'FO'::text) THEN 13 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TI'::text) THEN 14 ELSE CASE WHEN ((matricula_5.situacao)::text = 'ER'::text) THEN 15 ELSE 0 END END END END END END END END END END END END END END END), (CASE WHEN ((matricula_5.situacao)::text = 'AC'::text) THEN 'Abandono de Curso'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'PR'::text) THEN 'Pré-matrícula'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'DE'::text) THEN 'Desligado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'IN'::text) THEN 'Inativa'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'AT'::text) THEN 'Ativa'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'CA'::text) THEN 'Cancelada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'CF'::text) THEN 'Cancelada Financeiro'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'JU'::text) THEN 'Jubilado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TS'::text) THEN 'Transferida'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TR'::text) THEN 'Trancada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'FI'::text) THEN 'Finalizada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'PF'::text) THEN 'Provável Formando'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'FO'::text) THEN 'Formado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TI'::text) THEN 'Transferida Internamente'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'ER'::text) THEN 'Problema ao Tentar Definir Situação - Problema Importação'::text ELSE ''::text END END END END END END END END END END END END END END END), "*SELECT* 1_2".codigo, disciplina_5.codigo, (CASE WHEN (emptd.turma <> matriculaperiodo_5.turma) THEN 1 ELSE 0 END)
307. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.85..2,437.59 rows=1 width=94) (actual rows= loops=)

308. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.56..2,437.20 rows=1 width=45) (actual rows= loops=)

309. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.10..2,421.16 rows=1 width=46) (actual rows= loops=)

310. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.68..2,420.60 rows=1 width=36) (actual rows= loops=)

311. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.26..2,420.12 rows=1 width=39) (actual rows= loops=)

312. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.84..2,417.49 rows=1 width=25) (actual rows= loops=)

  • Join Filter: (emptd.disciplina = horarioturmadiaitem_3.disciplina)
313. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.42..2,416.96 rows=1 width=25) (actual rows= loops=)

314. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.00..2,414.48 rows=1 width=25) (actual rows= loops=)

315. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..2,411.97 rows=1 width=21) (actual rows= loops=)

316. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.43..2,404.38 rows=1 width=12) (actual rows= loops=)

  • Filter: (mptd.codigo IS NULL)
317. 0.000 0.000 ↓ 0.0

Seq Scan on exclusaomatriculaperiodoturmadisciplina emptd (cost=0.00..2,388.40 rows=6 width=12) (actual rows= loops=)

  • Filter: (dataultimaalteracao >= (now() - '01:00:00'::interval))
318. 0.000 0.000 ↓ 0.0

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd (cost=0.43..2.65 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ((turma = emptd.turma) AND (disciplina = emptd.disciplina))
  • Filter: (matriculaperiodo = emptd.matriculaperiodo)
319. 0.000 0.000 ↓ 0.0

Append (cost=0.29..7.57 rows=2 width=9) (actual rows= loops=)

320. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_2 (cost=0.29..2.52 rows=1 width=9) (actual rows= loops=)

321. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmanormal_1 (cost=0.29..2.51 rows=1 width=1,735) (actual rows= loops=)

  • Index Cond: (codigo = emptd.turma)
  • Filter: ((NOT turmaagrupada) AND ((NOT turmaagrupada) OR turmaagrupada))
322. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_2 (cost=2.79..5.05 rows=1 width=9) (actual rows= loops=)

323. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.79..5.04 rows=1 width=1,735) (actual rows= loops=)

324. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.50..2.51 rows=1 width=4) (actual rows= loops=)

  • Group Key: turmaagrupada_1.turmaorigem
325. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_1 (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = emptd.turma)
326. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma agrupada_1 (cost=0.29..2.51 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_1.turmaorigem)
  • Filter: (turmaagrupada AND ((NOT turmaagrupada) OR turmaagrupada))
327. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma horarioturma_3 (cost=0.28..2.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (turma = "*SELECT* 1_2".codigo)
328. 0.000 0.000 ↓ 0.0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_3 (cost=0.42..1.96 rows=53 width=8) (actual rows= loops=)

  • Index Cond: (horarioturma = horarioturma_3.codigo)
329. 0.000 0.000 ↓ 0.0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem horarioturmadiaitem_3 (cost=0.42..0.50 rows=2 width=8) (actual rows= loops=)

  • Index Cond: (horarioturmadia = horarioturmadia_3.codigo)
330. 0.000 0.000 ↓ 0.0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_5 (cost=0.42..2.64 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (codigo = emptd.matriculaperiodo)
331. 0.000 0.000 ↓ 0.0

Index Scan using matricula_pkey on matricula matricula_5 (cost=0.42..0.47 rows=1 width=25) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matriculaperiodo_5.matricula)::text)
332. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_5 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_5.aluno)
333. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_5 (cost=6.46..16.03 rows=1 width=4) (actual rows= loops=)

  • Recheck Cond: ((codigo = "*SELECT* 1_2".curso) OR (codigo = (SubPlan 27)))
  • Filter: (((NOT "*SELECT* 1_2".turmaagrupada) AND (codigo = "*SELECT* 1_2".curso)) OR ("*SELECT* 1_2".turmaagrupada AND (codigo = (SubPlan 27))))
334. 0.000 0.000 ↓ 0.0

BitmapOr "HashAggregate (cost=3,104,300.63..3,104,311.75 rows=1,112 width=134) (actual rows= loops=)

335. 0.000 0.000 ↓ 0.0

Append (cost=3,101,810.19..3,104,270.05 rows=1,112 width=134) (actual rows= loops=)

336. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3,101,810.19..3,101,826.85 rows=1,111 width=134) (actual rows= loops=)

  • Group Key: "*SELECT* 1".cpf, "*SELECT* 1".curso_codigo, "*SELECT* 1".curso_codigoorigem, "*SELECT* 1".codigosituacao, "*SELECT* 1".situacaomatricula, "*SELECT* 1".turma_codigo, "*SELECT* 1".modulo_codigo, "*SELECT* 1".vinculo_inicio, "*SELECT* 1".data_confirmacao, "*SELECT* 1".vinculo_fim, "*SELECT* 1".codigo_reposicao
337. 0.000 0.000 ↓ 0.0

Append (cost=1,232,482.94..3,101,779.64 rows=1,111 width=130) (actual rows= loops=)

338. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1 (cost=1,232,482.94..1,232,518.82 rows=261 width=90) (actual rows= loops=)

339. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,232,482.94..1,232,516.21 rows=261 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento.data, matricula.data, matricula.situacao, aluno.cpf, cursorep.codigo, matricula.curso, turma.codigo, disciplina.codigo, matriculaperiodoturmadisciplina.turma, matriculaperiodo.turma
340. 0.000 0.000 ↓ 0.0

Sort (cost=1,232,482.94..1,232,483.59 rows=261 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento.data, matricula.data, matricula.situacao, aluno.cpf, cursorep.codigo, matricula.curso, turma.codigo, disciplina.codigo, matriculaperiodoturmadisciplina.turma, matriculaperiodo.turma
341. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,948.06..1,232,472.46 rows=261 width=61) (actual rows= loops=)

342. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,947.63..1,232,350.73 rows=261 width=57) (actual rows= loops=)

343. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=18,947.20..1,232,122.41 rows=261 width=57) (actual rows= loops=)

  • Join Filter: ((contareceber.matriculaaluno)::text = (matricula.matricula)::text)
344. 0.000 0.000 ↓ 0.0

Nested Loop (cost=18,946.77..1,231,808.89 rows=261 width=71) (actual rows= loops=)

345. 0.000 0.000 ↓ 0.0

Hash Join (cost=18,946.35..1,231,661.32 rows=261 width=61) (actual rows= loops=)

  • Hash Cond: (turmarep.curso = cursorep.codigo)
346. 0.000 0.000 ↓ 0.0

Nested Loop (cost=18,924.04..1,231,638.33 rows=261 width=61) (actual rows= loops=)

347. 0.000 0.000 ↓ 0.0

Hash Join (cost=18,923.76..1,231,558.64 rows=261 width=57) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina.matriculaperiodo = matriculaperiodo.codigo)
  • Join Filter: (CASE WHEN ((curso.niveleducacional)::text = 'SU'::text) THEN ((((matricula.situacao)::text = 'AT'::text) AND ((matriculaperiodo.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END AND (((matricula.gradecurricularatual = historico.matrizcurricular) AND ((historico.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico.transferenciamatrizcurricularmatricula IS NULL) OR ((historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 4))))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicocursandoporcorrespondenciaapostransferencia AND (historico.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico.disciplina = (SubPlan 5)) AND ((NOT historico.historicoporequivalencia) OR (historico.historicoporequivalencia IS NULL))) OR ((matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicoequivalente AND (SubPlan 6)) OR ((historico.matrizcurricular = matriculaperiodo.gradecurricular) AND (matricula.gradecurricularatual <> historico.matrizcurricular) AND historico.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 7)))))
348. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9,815.27..1,222,271.89 rows=67,915 width=104) (actual rows= loops=)

349. 0.000 0.000 ↓ 0.0

Hash Join (cost=9,814.84..1,189,022.05 rows=65,973 width=64) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodoturmadisciplina.matricula)::text = (matricula.matricula)::text)
350. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,179.78..1,180,213.81 rows=65,973 width=41) (actual rows= loops=)

351. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,175.52..336,774.18 rows=65,973 width=43) (actual rows= loops=)

  • Hash Cond: (horarioturma.turma = turma.codigo)
  • Join Filter: (((matriculaperiodoturmadisciplina.disciplina = disciplina.codigo) OR (turma.turmaagrupada AND (SubPlan 2))) AND ((matriculaperiodoturmadisciplina.turma = turma.codigo) OR (SubPlan 3)))
352. 0.000 0.000 ↓ 0.0

Hash Join (cost=47.46..292,233.59 rows=16,513,208 width=42) (actual rows= loops=)

  • Hash Cond: (((matriculaperiodoturmadisciplina.ano)::text = (horarioturma.anovigente)::text) AND ((matriculaperiodoturmadisciplina.semestre)::text = (horarioturma.semestrevigente)::text))
353. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodoturmadisciplina (cost=0.00..70,537.35 rows=2,825,835 width=32) (actual rows= loops=)

354. 0.000 0.000 ↓ 0.0

Hash (cost=47.35..47.35 rows=7 width=14) (actual rows= loops=)

355. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.83..47.35 rows=7 width=14) (actual rows= loops=)

356. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.41..36.56 rows=7 width=18) (actual rows= loops=)

357. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..27.86 rows=7 width=18) (actual rows= loops=)

358. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.85..25.77 rows=7 width=16) (actual rows= loops=)

359. 0.000 0.000 ↓ 0.0

Index Scan using idx_horarioturmadiaitem_dataultimaalteracao on horarioturmadiaitem (cost=0.43..7.31 rows=7 width=16) (actual rows= loops=)

  • Index Cond: (dataultimaalteracao >= (now() - '01:00:00'::interval))
360. 0.000 0.000 ↓ 0.0

Index Scan using horarioturmadia_pkey on horarioturmadia (cost=0.42..2.64 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.horarioturmadia)
361. 0.000 0.000 ↓ 0.0

Index Scan using horarioturma_pkey on horarioturma (cost=0.28..0.30 rows=1 width=10) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadia.horarioturma)
362. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina (cost=0.28..1.24 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.disciplina)
363. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor (cost=0.42..1.54 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem.professor)
364. 0.000 0.000 ↓ 0.0

Hash (cost=891.36..891.36 rows=18,936 width=9) (actual rows= loops=)

365. 0.000 0.000 ↓ 0.0

Seq Scan on turma (cost=0.00..891.36 rows=18,936 width=9) (actual rows= loops=)

366.          

SubPlan (for Hash Join)

367. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de.disciplina
368. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

369. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = disciplina.codigo)
370. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina.codigo)
371. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_3 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma.codigo)
372. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma.curso) OR (codigo = (SubPlan 1)))
  • Filter: (((NOT turma.turmaagrupada) AND (codigo = turma.curso)) OR (turma.turmaagrupada AND (codigo = (SubPlan 1))))
373. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

374. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma.curso)
375. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 1))
376.          

SubPlan (for Bitmap Heap Scan)

377. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

378. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

379. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_2 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma.codigo)
380. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_2.turma)
381. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=37) (actual rows= loops=)

382. 0.000 0.000 ↓ 0.0

Seq Scan on matricula (cost=0.00..6,421.14 rows=177,114 width=37) (actual rows= loops=)

383. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina.codigo)
384. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=15) (actual rows= loops=)

385. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo (cost=0.00..6,843.77 rows=181,177 width=15) (actual rows= loops=)

386.          

SubPlan (for Hash Join)

387. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

388. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

390. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_1 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

392. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

395. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_2 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

398. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist.disciplina)
400. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico.disciplina) AND (matriculaperiodo = historico.matriculaperiodo) AND (matrizcurricular = matricula.gradecurricularatual))
401. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.turma)
402. 0.000 0.000 ↓ 0.0

Hash (cost=14.79..14.79 rows=601 width=4) (actual rows= loops=)

403. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep (cost=0.28..14.79 rows=601 width=4) (actual rows= loops=)

404. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula.aluno)
405. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
406. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber.codigo)
407. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento.negociacaorecebimento = codigo)
408. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2 (cost=1,556,343.87..1,556,392.27 rows=352 width=90) (actual rows= loops=)

409. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=1,556,343.87..1,556,388.75 rows=352 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_1.data, matricula_1.data, matricula_1.situacao, aluno_1.cpf, cursorep_1.codigo, matricula_1.curso, turma_1.codigo, disciplina_1.codigo, matriculaperiodoturmadisciplina_1.turma, matriculaperiodo_1.turma
410. 0.000 0.000 ↓ 0.0

Sort (cost=1,556,343.87..1,556,344.75 rows=352 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_1.data, matricula_1.data, matricula_1.situacao, aluno_1.cpf, cursorep_1.codigo, matricula_1.curso, turma_1.codigo, disciplina_1.codigo, matriculaperiodoturmadisciplina_1.turma, matriculaperiodo_1.turma
411. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,521.65..1,556,328.98 rows=352 width=61) (actual rows= loops=)

412. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,521.22..1,556,164.81 rows=352 width=57) (actual rows= loops=)

413. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1,378,520.79..1,555,856.88 rows=352 width=57) (actual rows= loops=)

  • Join Filter: (contareceber_1.matriculaperiodo = matriculaperiodoturmadisciplina_1.matriculaperiodo)
414. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,378,520.36..1,554,975.37 rows=352 width=71) (actual rows= loops=)

415. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,378,519.94..1,554,776.35 rows=352 width=61) (actual rows= loops=)

  • Hash Cond: (turmarep_1.curso = cursorep_1.codigo)
416. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1,378,497.64..1,554,753.12 rows=352 width=61) (actual rows= loops=)

417. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,378,497.35..1,554,010.45 rows=352 width=57) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodoturmadisciplina_1.matricula)::text = (matricula_1.matricula)::text)
  • Join Filter: (CASE WHEN ((curso_1.niveleducacional)::text = 'SU'::text) THEN ((((matricula_1.situacao)::text = 'AT'::text) AND ((matriculaperiodo_1.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_1.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END 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 11))))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicocursandoporcorrespondenciaapostransferencia AND (historico_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_1.disciplina = (SubPlan 12)) AND ((NOT historico_1.historicoporequivalencia) OR (historico_1.historicoporequivalencia IS NULL))) OR ((matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicoequivalente AND (SubPlan 13)) OR ((historico_1.matrizcurricular = matriculaperiodo_1.gradecurricular) AND (matricula_1.gradecurricularatual <> historico_1.matrizcurricular) AND historico_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 14)))))
418. 0.000 0.000 ↓ 0.0

Merge Join (cost=1,369,862.28..1,545,134.83 rows=91,637 width=92) (actual rows= loops=)

  • Merge Cond: (historico_1.matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_1.codigo)
419. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_1 (cost=0.43..171,551.13 rows=2,909,008 width=48) (actual rows= loops=)

420. 0.000 0.000 ↓ 0.0

Sort (cost=1,369,861.80..1,370,084.35 rows=89,017 width=52) (actual rows= loops=)

  • Sort Key: matriculaperiodoturmadisciplina_1.codigo
421. 0.000 0.000 ↓ 0.0

Hash Join (cost=40,105.81..1,362,543.81 rows=89,017 width=52) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina_1.matriculaperiodo = matriculaperiodo_1.codigo)
422. 0.000 0.000 ↓ 0.0

Hash Join (cost=30,997.33..1,353,201.66 rows=89,017 width=41) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.professor = professor_1.codigo)
423. 0.000 0.000 ↓ 0.0

Nested Loop (cost=12,192.38..1,334,163.03 rows=89,017 width=45) (actual rows= loops=)

424. 0.000 0.000 ↓ 0.0

Hash Join (cost=12,188.12..178,126.71 rows=90,424 width=47) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.disciplina = disciplina_1.codigo)
  • Join Filter: ((matriculaperiodoturmadisciplina_1.disciplina = disciplina_1.codigo) OR (turma_1.turmaagrupada AND (SubPlan 9)))
425. 0.000 0.000 ↓ 0.0

Hash Join (cost=11,980.02..148,164.01 rows=11,317,242 width=51) (actual rows= loops=)

  • Hash Cond: (horarioturmadia_1.horarioturma = horarioturma_1.codigo)
426. 0.000 0.000 ↓ 0.0

Hash Join (cost=5,208.33..13,413.54 rows=263,223 width=16) (actual rows= loops=)

  • Hash Cond: (horarioturmadiaitem_1.horarioturmadia = horarioturmadia_1.codigo)
427. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadiaitem horarioturmadiaitem_1 (cost=0.00..7,514.23 rows=263,223 width=16) (actual rows= loops=)

428. 0.000 0.000 ↓ 0.0

Hash (cost=3,121.48..3,121.48 rows=166,948 width=8) (actual rows= loops=)

429. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadia horarioturmadia_1 (cost=0.00..3,121.48 rows=166,948 width=8) (actual rows= loops=)

430. 0.000 0.000 ↓ 0.0

Hash (cost=4,871.31..4,871.31 rows=152,030 width=43) (actual rows= loops=)

431. 0.000 0.000 ↓ 0.0

Hash Join (cost=1,128.78..4,871.31 rows=152,030 width=43) (actual rows= loops=)

  • Hash Cond: (horarioturma_1.turma = turma_1.codigo)
  • Join Filter: ((matriculaperiodoturmadisciplina_1.turma = turma_1.codigo) OR (SubPlan 10))
432. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..2,799.57 rows=304,044 width=38) (actual rows= loops=)

433. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodoturmadisciplina_dataultimaalteracao on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.43..113.95 rows=103 width=32) (actual rows= loops=)

  • Index Cond: (dataultimaalteracao >= (now() - '01:00:00'::interval))
434. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_semestre on horarioturma horarioturma_1 (cost=0.28..24.39 rows=168 width=10) (actual rows= loops=)

  • Index Cond: ((semestrevigente)::text = (matriculaperiodoturmadisciplina_1.semestre)::text)
  • Filter: ((matriculaperiodoturmadisciplina_1.ano)::text = (anovigente)::text)
435. 0.000 0.000 ↓ 0.0

Hash (cost=891.36..891.36 rows=18,936 width=9) (actual rows= loops=)

436. 0.000 0.000 ↓ 0.0

Seq Scan on turma turma_1 (cost=0.00..891.36 rows=18,936 width=9) (actual rows= loops=)

437.          

SubPlan (for Hash Join)

438. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_5 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_1.codigo)
439. 0.000 0.000 ↓ 0.0

Hash (cost=124.14..124.14 rows=6,717 width=4) (actual rows= loops=)

440. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_1 (cost=0.28..124.14 rows=6,717 width=4) (actual rows= loops=)

441.          

SubPlan (for Hash Join)

442. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de_1.disciplina
443. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

444. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de_1 (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = disciplina_1.codigo)
445. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2_1 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina_1.codigo)
446. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_1 (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma_1.curso) OR (codigo = (SubPlan 8)))
  • Filter: (((NOT turma_1.turmaagrupada) AND (codigo = turma_1.curso)) OR (turma_1.turmaagrupada AND (codigo = (SubPlan 8))))
447. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

448. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma_1.curso)
449. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 8))
450.          

SubPlan (for Bitmap Heap Scan)

451. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

452. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

453. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_4 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_1.codigo)
454. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_1 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_4.turma)
455. 0.000 0.000 ↓ 0.0

Hash (cost=12,179.44..12,179.44 rows=530,041 width=4) (actual rows= loops=)

456. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_1 (cost=0.42..12,179.44 rows=530,041 width=4) (actual rows= loops=)

457. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=15) (actual rows= loops=)

458. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo matriculaperiodo_1 (cost=0.00..6,843.77 rows=181,177 width=15) (actual rows= loops=)

459. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=37) (actual rows= loops=)

460. 0.000 0.000 ↓ 0.0

Seq Scan on matricula matricula_1 (cost=0.00..6,421.14 rows=177,114 width=37) (actual rows= loops=)

461.          

SubPlan (for Hash Join)

462. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

463. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_4 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

465. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_5 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

467. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

470. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_1 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_6 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

473. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_1.disciplina)
475. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_1.disciplina) AND (matriculaperiodo = historico_1.matriculaperiodo) AND (matrizcurricular = matricula_1.gradecurricularatual))
476. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep_1 (cost=0.29..2.11 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_1.turma)
477. 0.000 0.000 ↓ 0.0

Hash (cost=14.79..14.79 rows=601 width=4) (actual rows= loops=)

478. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep_1 (cost=0.28..14.79 rows=601 width=4) (actual rows= loops=)

479. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_1 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_1.aluno)
480. 0.000 0.000 ↓ 0.0

Index Scan using ch_contareceber_matriculaaluno on contareceber contareceber_1 (cost=0.43..2.49 rows=1 width=22) (actual rows= loops=)

  • Index Cond: ((matriculaaluno)::text = (matricula_1.matricula)::text)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
481. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_1 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_1.codigo)
482. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_1 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_1.negociacaorecebimento = codigo)
483. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 3 (cost=237,579.20..237,647.40 rows=496 width=90) (actual rows= loops=)

484. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=237,579.20..237,642.44 rows=496 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_2.data, matricula_2.data, matricula_2.situacao, aluno_2.cpf, curso_2.codigo, matricula_2.curso, turma_2.codigo, disciplina_2.codigo, matriculaperiodoturmadisciplina_2.turma, matriculaperiodo_2.turma
485. 0.000 0.000 ↓ 0.0

Sort (cost=237,579.20..237,580.44 rows=496 width=61) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_2.data, matricula_2.data, matricula_2.situacao, aluno_2.cpf, curso_2.codigo, matricula_2.curso, turma_2.codigo, disciplina_2.codigo, matriculaperiodoturmadisciplina_2.turma, matriculaperiodo_2.turma
486. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.89..237,556.99 rows=496 width=61) (actual rows= loops=)

487. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.46..237,325.65 rows=496 width=57) (actual rows= loops=)

488. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=10,813.03..236,891.76 rows=496 width=57) (actual rows= loops=)

  • Join Filter: ((contareceber_2.matriculaaluno)::text = (matricula_2.matricula)::text)
489. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,812.60..235,689.89 rows=496 width=71) (actual rows= loops=)

490. 0.000 0.000 ↓ 0.0

Nested Loop (cost=10,812.18..234,379.21 rows=496 width=61) (actual rows= loops=)

491. 0.000 0.000 ↓ 0.0

Hash Join (cost=10,811.75..234,151.76 rows=496 width=65) (actual rows= loops=)

  • Hash Cond: (horarioturmadia_2.codigo = horarioturmadiaitem_2.horarioturmadia)
  • Join Filter: ((horarioturmadiaitem_2.disciplina = matriculaperiodoturmadisciplina_2.disciplina) OR (turma_2.turmaagrupada AND (SubPlan 17)))
492. 0.000 0.000 ↓ 0.0

Nested Loop (cost=7.23..28,283.18 rows=34,324 width=66) (actual rows= loops=)

493. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6.81..26,474.29 rows=727 width=66) (actual rows= loops=)

  • Join Filter: CASE WHEN ((curso_2.niveleducacional)::text = 'SU'::text) THEN ((((matricula_2.situacao)::text = 'AT'::text) AND ((matriculaperiodo_2.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_2.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END
494. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.56..7,580.20 rows=1,476 width=69) (actual rows= loops=)

495. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.27..6,750.76 rows=1,476 width=64) (actual rows= loops=)

496. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.99..6,477.40 rows=1 width=58) (actual rows= loops=)

497. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.70..6,477.10 rows=1 width=54) (actual rows= loops=)

  • Join Filter: (((matricula_2.gradecurricularatual = historico_2.matrizcurricular) AND ((historico_2.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_2.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_2.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 18))))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicocursandoporcorrespondenciaapostransferencia AND (historico_2.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_2.disciplina = (SubPlan 19)) AND ((NOT historico_2.historicoporequivalencia) OR (historico_2.historicoporequivalencia IS NULL))) OR ((matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicoequivalente AND (SubPlan 20)) OR ((historico_2.matrizcurricular = matriculaperiodo_2.gradecurricular) AND (matricula_2.gradecurricularatual <> historico_2.matrizcurricular) AND historico_2.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 21))))
498. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.27..32.35 rows=94 width=66) (actual rows= loops=)

499. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..24.09 rows=6 width=52) (actual rows= loops=)

500. 0.000 0.000 ↓ 0.0

Index Scan using idx_updated_updated on matricula matricula_2 (cost=0.42..8.21 rows=6 width=37) (actual rows= loops=)

  • Index Cond: (updated >= (now() - '01:00:00'::interval))
501. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo matriculaperiodo_2 (cost=0.42..2.64 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matricula_2.matricula)::text)
502. 0.000 0.000 ↓ 0.0

Index Scan using ch_matriculaperiodoturmadisciplina_matriculaperiodo on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.43..1.16 rows=22 width=18) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_2.codigo)
503. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_2 (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_2.codigo)
504.          

SubPlan (for Nested Loop)

505. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

506. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_8 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

508. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_9 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

510. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

513. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_2 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_10 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

516. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_2.disciplina)
518. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_2.disciplina) AND (matriculaperiodo = historico_2.matriculaperiodo) AND (matrizcurricular = matricula_2.gradecurricularatual))
519. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_2 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_2.disciplina)
520. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma horarioturma_2 (cost=0.28..272.52 rows=84 width=10) (actual rows= loops=)

  • Index Cond: (((anovigente)::text = (matriculaperiodoturmadisciplina_2.ano)::text) AND ((semestrevigente)::text = (matriculaperiodoturmadisciplina_2.semestre)::text))
  • Filter: ((turma = matriculaperiodoturmadisciplina_2.turma) OR (SubPlan 15))
521.          

SubPlan (for Index Scan)

522. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_6 (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = matriculaperiodoturmadisciplina_2.turma)
523. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turma_2 (cost=0.29..0.56 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = horarioturma_2.turma)
524. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_2 (cost=4.26..12.77 rows=1 width=7) (actual rows= loops=)

  • Recheck Cond: ((codigo = turma_2.curso) OR (codigo = (SubPlan 16)))
  • Filter: (((NOT turma_2.turmaagrupada) AND (codigo = turma_2.curso)) OR (turma_2.turmaagrupada AND (codigo = (SubPlan 16))))
525. 0.000 0.000 ↓ 0.0

BitmapOr (cost=4.26..4.26 rows=2 width=0) (actual rows= loops=)

526. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..0.28 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = turma_2.curso)
527. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..3.98 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 16))
528.          

SubPlan (for Bitmap Heap Scan)

529. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

530. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

531. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_7 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = turma_2.codigo)
532. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_2 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_7.turma)
533. 0.000 0.000 ↓ 0.0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_2 (cost=0.42..1.96 rows=53 width=8) (actual rows= loops=)

  • Index Cond: (horarioturma = horarioturma_2.codigo)
534. 0.000 0.000 ↓ 0.0

Hash (cost=7,514.23..7,514.23 rows=263,223 width=16) (actual rows= loops=)

535. 0.000 0.000 ↓ 0.0

Seq Scan on horarioturmadiaitem horarioturmadiaitem_2 (cost=0.00..7,514.23 rows=263,223 width=16) (actual rows= loops=)

536.          

SubPlan (for Hash Join)

537. 0.000 0.000 ↓ 0.0

HashAggregate (cost=3.57..3.60 rows=3 width=4) (actual rows= loops=)

  • Group Key: de_2.disciplina
538. 0.000 0.000 ↓ 0.0

Append (cost=0.00..3.56 rows=3 width=4) (actual rows= loops=)

539. 0.000 0.000 ↓ 0.0

Seq Scan on disciplinaequivalente de_2 (cost=0.00..2.24 rows=1 width=4) (actual rows= loops=)

  • Filter: (equivalente = horarioturmadiaitem_2.disciplina)
540. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplinaequivalente_pkey on disciplinaequivalente de2_2 (cost=0.14..1.28 rows=2 width=4) (actual rows= loops=)

  • Index Cond: (disciplina = horarioturmadiaitem_2.disciplina)
541. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_2 (cost=0.42..0.46 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem_2.professor)
542. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_2 (cost=0.42..2.64 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_2.aluno)
543. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_2 (cost=0.43..2.41 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_2.codigo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
544. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_2 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_2.codigo)
545. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_2 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_2.negociacaorecebimento = codigo)
546. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 4 (cost=154.11..154.24 rows=1 width=90) (actual rows= loops=)

547. 0.000 0.000 ↓ 0.0

Group (cost=154.11..154.23 rows=1 width=109) (actual rows= loops=)

  • Group Key: negociacaorecebimento_3.data, matricula_3.data, matricula_3.situacao, aluno_3.cpf, cursorep_2.codigo, matricula_3.curso, turma_3.codigo, disciplina_3.codigo, matriculaperiodoturmadisciplina_3.turma, matriculaperiodo_3.turma
548. 0.000 0.000 ↓ 0.0

Sort (cost=154.11..154.12 rows=1 width=57) (actual rows= loops=)

  • Sort Key: negociacaorecebimento_3.data, matricula_3.data, matricula_3.situacao, aluno_3.cpf, cursorep_2.codigo, matricula_3.curso, turma_3.codigo, disciplina_3.codigo
549. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=45.23..154.10 rows=1 width=57) (actual rows= loops=)

550. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=44.80..153.63 rows=1 width=53) (actual rows= loops=)

551. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=44.37..152.76 rows=1 width=53) (actual rows= loops=)

  • Join Filter: ((contareceber_3.matriculaaluno)::text = (matricula_3.matricula)::text)
552. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.94..151.56 rows=1 width=67) (actual rows= loops=)

  • Join Filter: (((matricula_3.gradecurricularatual = historico_3.matrizcurricular) AND ((historico_3.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT historico_3.historicocursandoporcorrespondenciaapostransferencia)) AND ((historico_3.transferenciamatrizcurricularmatricula IS NULL) OR ((historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 22))))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicocursandoporcorrespondenciaapostransferencia AND (historico_3.transferenciamatrizcurricularmatricula IS NOT NULL) AND (historico_3.disciplina = (SubPlan 23)) AND ((NOT historico_3.historicoporequivalencia) OR (historico_3.historicoporequivalencia IS NULL))) OR ((matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicoequivalente AND (SubPlan 24)) OR ((historico_3.matrizcurricular = matriculaperiodo_3.gradecurricular) AND (matricula_3.gradecurricularatual <> historico_3.matrizcurricular) AND historico_3.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 25))))
553. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.51..83.00 rows=1 width=79) (actual rows= loops=)

554. 0.000 0.000 ↓ 0.0

Nested Loop (cost=43.08..80.35 rows=1 width=69) (actual rows= loops=)

555. 0.000 0.000 ↓ 0.0

Nested Loop (cost=42.66..79.01 rows=1 width=73) (actual rows= loops=)

556. 0.000 0.000 ↓ 0.0

Nested Loop (cost=42.38..78.72 rows=1 width=73) (actual rows= loops=)

  • Join Filter: (turma_3.codigo = turmarep_2.codigo)
557. 0.000 0.000 ↓ 0.0

Hash Join (cost=42.10..78.40 rows=1 width=77) (actual rows= loops=)

  • Hash Cond: (programacaotutoriaonlineprofessor.programacaotutoriaonline = programacaotutoriaonline.codigo)
558. 0.000 0.000 ↓ 0.0

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..29.94 rows=1,694 width=8) (actual rows= loops=)

559. 0.000 0.000 ↓ 0.0

Hash (cost=42.08..42.08 rows=1 width=77) (actual rows= loops=)

560. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.82..42.08 rows=1 width=77) (actual rows= loops=)

  • Join Filter: (disciplina_3.codigo = programacaotutoriaonline.disciplina)
561. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.54..29.81 rows=1 width=77) (actual rows= loops=)

  • Join Filter: ((turma_3.codigo = turmadisciplina.turma) AND (disciplina_3.codigo = turmadisciplina.disciplina))
562. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.12..29.35 rows=1 width=69) (actual rows= loops=)

563. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.84..29.05 rows=1 width=65) (actual rows= loops=)

  • Join Filter: (turma_3.codigo = matriculaperiodoturmadisciplina_3.turma)
564. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.41..27.83 rows=1 width=53) (actual rows= loops=)

  • Join Filter: CASE WHEN ((curso_3.niveleducacional)::text = 'SU'::text) THEN ((matriculaperiodo_3.situacaomatriculaperiodo)::text = 'AT'::text) ELSE true END
565. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.13..25.95 rows=6 width=60) (actual rows= loops=)

566. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.84..24.09 rows=6 width=52) (actual rows= loops=)

567. 0.000 0.000 ↓ 0.0

Index Scan using idx_updated_updated on matricula matricula_3 (cost=0.42..8.21 rows=6 width=37) (actual rows= loops=)

  • Index Cond: (updated >= (now() - '01:00:00'::interval))
568. 0.000 0.000 ↓ 0.0

Index Scan using idx_matriculaperiodo_matricula_ano_semestre on matriculaperiodo matriculaperiodo_3 (cost=0.42..2.64 rows=1 width=29) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matricula_3.matricula)::text)
569. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turma_3 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodo_3.turma)
570. 0.000 0.000 ↓ 0.0

Index Scan using curso_pkey on curso curso_3 (cost=0.28..0.30 rows=1 width=7) (actual rows= loops=)

  • Index Cond: (codigo = turma_3.curso)
  • Filter: ((modalidadecurso)::text = 'HIBRIDO'::text)
571. 0.000 0.000 ↓ 0.0

Index Scan using ch_matriculaperiodoturmadisciplina_matriculaperiodo on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.43..1.21 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodo_3.codigo)
  • Filter: (matriculaperiodo_3.turma = turma)
572. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_3 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.disciplina)
573. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina (cost=0.42..0.44 rows=1 width=8) (actual rows= loops=)

  • Index Cond: ((turma = matriculaperiodoturmadisciplina_3.turma) AND (disciplina = matriculaperiodoturmadisciplina_3.disciplina))
  • Filter: ((definicoestutoriaonline)::text = 'DINAMICA'::text)
574. 0.000 0.000 ↓ 0.0

Index Scan using unique_programacaotutoriaonline on programacaotutoriaonline (cost=0.28..12.25 rows=2 width=12) (actual rows= loops=)

  • Index Cond: (turma = turma_3.codigo)
  • Filter: definirperiodoaulaonline
575. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmarep_2 (cost=0.29..0.31 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_3.turma)
576. 0.000 0.000 ↓ 0.0

Index Only Scan using curso_pkey on curso cursorep_2 (cost=0.28..0.29 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = turmarep_2.curso)
577. 0.000 0.000 ↓ 0.0

Index Only Scan using pessoa_pkey on pessoa professor_3 (cost=0.42..1.34 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = programacaotutoriaonlineprofessor.professor)
578. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_3 (cost=0.42..2.64 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_3.aluno)
579. 0.000 0.000 ↓ 0.0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico historico_3 (cost=0.43..0.49 rows=1 width=48) (actual rows= loops=)

  • Index Cond: (matriculaperiodoturmadisciplina = matriculaperiodoturmadisciplina_3.codigo)
580.          

SubPlan (for Nested Loop)

581. 0.000 0.000 ↓ 0.0

Limit (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

582. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico his_12 (cost=0.43..25.63 rows=1 width=4) (actual rows= loops=)

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

Limit (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

584. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on historico his_13 (cost=13.08..14.21 rows=1 width=4) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

586. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

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

Nested Loop Semi Join (cost=13.51..39.68 rows=1 width=0) (actual rows= loops=)

589. 0.000 0.000 ↓ 0.0

Index Scan using ch_historico_matricula on historico hist_3 (cost=0.43..25.46 rows=1 width=24) (actual rows= loops=)

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

Bitmap Heap Scan on historico his_14 (cost=13.08..14.21 rows=1 width=24) (actual rows= loops=)

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

BitmapAnd (cost=13.08..13.08 rows=1 width=0) (actual rows= loops=)

592. 0.000 0.000 ↓ 0.0

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

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

Bitmap Index Scan on ch_historico_disciplina (cost=0.00..11.14 rows=841 width=0) (actual rows= loops=)

  • Index Cond: (disciplina = hist_3.disciplina)
594. 0.000 0.000 ↓ 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) (actual rows= loops=)

  • Index Cond: ((disciplina = historico_3.disciplina) AND (matriculaperiodo = historico_3.matriculaperiodo) AND (matrizcurricular = matricula_3.gradecurricularatual))
595. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_3 (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina_3.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
596. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_3 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_3.codigo)
597. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_3 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_3.negociacaorecebimento = codigo)
598. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 5 (cost=17,889.44..75,061.34 rows=1 width=90) (actual rows= loops=)

599. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,889.44..75,061.33 rows=1 width=86) (actual rows= loops=)

600. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,889.01..75,060.78 rows=1 width=61) (actual rows= loops=)

601. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=17,888.58..75,059.90 rows=1 width=61) (actual rows= loops=)

  • Join Filter: ((contareceber_4.matriculaaluno)::text = (matricula_4.matricula)::text)
602. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,888.15..75,058.70 rows=1 width=75) (actual rows= loops=)

  • Join Filter: ((((curso_4.modalidadecurso)::text = 'ON_LINE'::text) OR ((matriculaperiodoturmadisciplina_4.modalidadedisciplina)::text = 'ON_LINE'::text)) AND CASE WHEN ((curso_4.niveleducacional)::text = 'SU'::text) THEN ((((matricula_4.situacao)::text = 'AT'::text) AND ((matriculaperiodo_4.situacaomatriculaperiodo)::text = 'AT'::text)) OR ((matricula_4.situacao)::text = ANY ('{TR,AC,CA,TI,TS,JU,FO}'::text[]))) ELSE true END)
603. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,881.69..75,042.64 rows=1 width=89) (actual rows= loops=)

604. 0.000 0.000 ↓ 0.0

Nested Loop (cost=17,881.27..75,042.07 rows=1 width=79) (actual rows= loops=)

  • Join Filter: (programacaotutoriaonline_1.turma = "*SELECT* 1_1".codigo)
605. 0.000 0.000 ↓ 0.0

Hash Join (cost=17,880.98..74,692.70 rows=46 width=74) (actual rows= loops=)

  • Hash Cond: ((matriculaperiodo_4.matricula)::text = (matricula_4.matricula)::text)
  • Join Filter: ((matriculaperiodoturmadisciplina_4.dataultimaalteracao >= (now() - '01:00:00'::interval)) OR (matricula_4.updated >= (now() - '01:00:00'::interval)))
606. 0.000 0.000 ↓ 0.0

Hash Join (cost=9,245.92..64,298.43 rows=670,173 width=63) (actual rows= loops=)

  • Hash Cond: (matriculaperiodoturmadisciplina_4.matriculaperiodo = matriculaperiodo_4.codigo)
607. 0.000 0.000 ↓ 0.0

Nested Loop (cost=137.43..53,430.70 rows=670,173 width=42) (actual rows= loops=)

608. 0.000 0.000 ↓ 0.0

Merge Join (cost=137.00..280.15 rows=1,593 width=20) (actual rows= loops=)

  • Merge Cond: (disciplina_4.codigo = programacaotutoriaonline_1.disciplina)
609. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_4 (cost=0.28..124.14 rows=6,717 width=4) (actual rows= loops=)

610. 0.000 0.000 ↓ 0.0

Sort (cost=136.66..140.64 rows=1,593 width=16) (actual rows= loops=)

  • Sort Key: programacaotutoriaonline_1.disciplina
611. 0.000 0.000 ↓ 0.0

Seq Scan on programacaotutoriaonline programacaotutoriaonline_1 (cost=0.00..51.93 rows=1,593 width=16) (actual rows= loops=)

612. 0.000 0.000 ↓ 0.0

Index Scan using unique_matriculaperiodoturmadisciplina_disc_matriculaperi_turma on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_4 (cost=0.43..25.52 rows=785 width=30) (actual rows= loops=)

  • Index Cond: (disciplina = disciplina_4.codigo)
613. 0.000 0.000 ↓ 0.0

Hash (cost=6,843.77..6,843.77 rows=181,177 width=25) (actual rows= loops=)

614. 0.000 0.000 ↓ 0.0

Seq Scan on matriculaperiodo matriculaperiodo_4 (cost=0.00..6,843.77 rows=181,177 width=25) (actual rows= loops=)

615. 0.000 0.000 ↓ 0.0

Hash (cost=6,421.14..6,421.14 rows=177,114 width=41) (actual rows= loops=)

616. 0.000 0.000 ↓ 0.0

Seq Scan on matricula matricula_4 (cost=0.00..6,421.14 rows=177,114 width=41) (actual rows= loops=)

617. 0.000 0.000 ↓ 0.0

Append (cost=0.29..7.57 rows=2 width=9) (actual rows= loops=)

618. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_1 (cost=0.29..2.52 rows=1 width=9) (actual rows= loops=)

619. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmanormal (cost=0.29..2.51 rows=1 width=1,735) (actual rows= loops=)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina_4.turma)
  • Filter: ((NOT turmaagrupada) AND ((NOT turmaagrupada) OR turmaagrupada))
620. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_1 (cost=2.79..5.05 rows=1 width=9) (actual rows= loops=)

621. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.79..5.04 rows=1 width=1,735) (actual rows= loops=)

622. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.50..2.51 rows=1 width=4) (actual rows= loops=)

  • Group Key: turmaagrupada.turmaorigem
623. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = matriculaperiodoturmadisciplina_4.turma)
624. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma agrupada (cost=0.29..2.51 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada.turmaorigem)
  • Filter: (turmaagrupada AND ((NOT turmaagrupada) OR turmaagrupada))
625. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_4 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_4.aluno)
626. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_4 (cost=6.46..16.03 rows=1 width=17) (actual rows= loops=)

  • Recheck Cond: ((codigo = "*SELECT* 1_1".curso) OR (codigo = (SubPlan 26)))
  • Filter: (((NOT "*SELECT* 1_1".turmaagrupada) AND (codigo = "*SELECT* 1_1".curso)) OR ("*SELECT* 1_1".turmaagrupada AND (codigo = (SubPlan 26))))
627. 0.000 0.000 ↓ 0.0

BitmapOr (cost=6.46..6.46 rows=2 width=0) (actual rows= loops=)

628. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..1.38 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = "*SELECT* 1_1".curso)
629. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..5.08 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 26))
630.          

SubPlan (for Bitmap Heap Scan)

631. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

632. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

633. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_8 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = "*SELECT* 1_1".codigo)
634. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_3 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_8.turma)
635. 0.000 0.000 ↓ 0.0

Index Scan using contareceber_matriculaperiodo on contareceber contareceber_4 (cost=0.43..1.19 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (matriculaperiodo = matriculaperiodoturmadisciplina_4.matriculaperiodo)
  • Filter: (((tipoorigem)::text = 'MAT'::text) AND ((situacao)::text = 'RE'::text))
636. 0.000 0.000 ↓ 0.0

Index Scan using unq_contarecebernegociacaorecebimento_contareceber on contarecebernegociacaorecebimento contarecebernegociacaorecebimento_4 (cost=0.43..0.87 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (contareceber = contareceber_4.codigo)
637. 0.000 0.000 ↓ 0.0

Index Scan using negociacaorecebimento_pkey on negociacaorecebimento negociacaorecebimento_4 (cost=0.43..0.47 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (contarecebernegociacaorecebimento_4.negociacaorecebimento = codigo)
638. 0.000 0.000 ↓ 0.0

Unique (cost=2,437.60..2,437.62 rows=1 width=94) (actual rows= loops=)

639. 0.000 0.000 ↓ 0.0

Sort (cost=2,437.60..2,437.60 rows=1 width=94) (actual rows= loops=)

  • Sort Key: aluno_5.cpf, curso_5.codigo, matricula_5.curso, (CASE WHEN ((matricula_5.situacao)::text = 'AC'::text) THEN 1 ELSE CASE WHEN ((matricula_5.situacao)::text = 'PR'::text) THEN 2 ELSE CASE WHEN ((matricula_5.situacao)::text = 'DE'::text) THEN 3 ELSE CASE WHEN ((matricula_5.situacao)::text = 'IN'::text) THEN 4 ELSE CASE WHEN ((matricula_5.situacao)::text = 'AT'::text) THEN 5 ELSE CASE WHEN ((matricula_5.situacao)::text = 'CA'::text) THEN 6 ELSE CASE WHEN ((matricula_5.situacao)::text = 'CF'::text) THEN 7 ELSE CASE WHEN ((matricula_5.situacao)::text = 'JU'::text) THEN 8 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TS'::text) THEN 9 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TR'::text) THEN 10 ELSE CASE WHEN ((matricula_5.situacao)::text = 'FI'::text) THEN 11 ELSE CASE WHEN ((matricula_5.situacao)::text = 'PF'::text) THEN 12 ELSE CASE WHEN ((matricula_5.situacao)::text = 'FO'::text) THEN 13 ELSE CASE WHEN ((matricula_5.situacao)::text = 'TI'::text) THEN 14 ELSE CASE WHEN ((matricula_5.situacao)::text = 'ER'::text) THEN 15 ELSE 0 END END END END END END END END END END END END END END END), (CASE WHEN ((matricula_5.situacao)::text = 'AC'::text) THEN 'Abandono de Curso'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'PR'::text) THEN 'Pré-matrícula'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'DE'::text) THEN 'Desligado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'IN'::text) THEN 'Inativa'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'AT'::text) THEN 'Ativa'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'CA'::text) THEN 'Cancelada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'CF'::text) THEN 'Cancelada Financeiro'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'JU'::text) THEN 'Jubilado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TS'::text) THEN 'Transferida'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TR'::text) THEN 'Trancada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'FI'::text) THEN 'Finalizada'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'PF'::text) THEN 'Provável Formando'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'FO'::text) THEN 'Formado'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'TI'::text) THEN 'Transferida Internamente'::text ELSE CASE WHEN ((matricula_5.situacao)::text = 'ER'::text) THEN 'Problema ao Tentar Definir Situação - Problema Importação'::text ELSE ''::text END END END END END END END END END END END END END END END), "*SELECT* 1_2".codigo, disciplina_5.codigo, (CASE WHEN (emptd.turma <> matriculaperiodo_5.turma) THEN 1 ELSE 0 END)
640. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.85..2,437.59 rows=1 width=94) (actual rows= loops=)

641. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.56..2,437.20 rows=1 width=45) (actual rows= loops=)

642. 0.000 0.000 ↓ 0.0

Nested Loop (cost=3.10..2,421.16 rows=1 width=46) (actual rows= loops=)

643. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.68..2,420.60 rows=1 width=36) (actual rows= loops=)

644. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.26..2,420.12 rows=1 width=39) (actual rows= loops=)

645. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.84..2,417.49 rows=1 width=25) (actual rows= loops=)

  • Join Filter: (emptd.disciplina = horarioturmadiaitem_3.disciplina)
646. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.42..2,416.96 rows=1 width=25) (actual rows= loops=)

647. 0.000 0.000 ↓ 0.0

Nested Loop (cost=1.00..2,414.48 rows=1 width=25) (actual rows= loops=)

648. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.72..2,411.97 rows=1 width=21) (actual rows= loops=)

649. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.43..2,404.38 rows=1 width=12) (actual rows= loops=)

  • Filter: (mptd.codigo IS NULL)
650. 0.000 0.000 ↓ 0.0

Seq Scan on exclusaomatriculaperiodoturmadisciplina emptd (cost=0.00..2,388.40 rows=6 width=12) (actual rows= loops=)

  • Filter: (dataultimaalteracao >= (now() - '01:00:00'::interval))
651. 0.000 0.000 ↓ 0.0

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd (cost=0.43..2.65 rows=1 width=16) (actual rows= loops=)

  • Index Cond: ((turma = emptd.turma) AND (disciplina = emptd.disciplina))
  • Filter: (matriculaperiodo = emptd.matriculaperiodo)
652. 0.000 0.000 ↓ 0.0

Append (cost=0.29..7.57 rows=2 width=9) (actual rows= loops=)

653. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 1_2 (cost=0.29..2.52 rows=1 width=9) (actual rows= loops=)

654. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma turmanormal_1 (cost=0.29..2.51 rows=1 width=1,735) (actual rows= loops=)

  • Index Cond: (codigo = emptd.turma)
  • Filter: ((NOT turmaagrupada) AND ((NOT turmaagrupada) OR turmaagrupada))
655. 0.000 0.000 ↓ 0.0

Subquery Scan on *SELECT* 2_2 (cost=2.79..5.05 rows=1 width=9) (actual rows= loops=)

656. 0.000 0.000 ↓ 0.0

Nested Loop (cost=2.79..5.04 rows=1 width=1,735) (actual rows= loops=)

657. 0.000 0.000 ↓ 0.0

HashAggregate (cost=2.50..2.51 rows=1 width=4) (actual rows= loops=)

  • Group Key: turmaagrupada_1.turmaorigem
658. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_1 (cost=0.29..2.50 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (turma = emptd.turma)
659. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma agrupada_1 (cost=0.29..2.51 rows=1 width=9) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_1.turmaorigem)
  • Filter: (turmaagrupada AND ((NOT turmaagrupada) OR turmaagrupada))
660. 0.000 0.000 ↓ 0.0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma horarioturma_3 (cost=0.28..2.50 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (turma = "*SELECT* 1_2".codigo)
661. 0.000 0.000 ↓ 0.0

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia horarioturmadia_3 (cost=0.42..1.96 rows=53 width=8) (actual rows= loops=)

  • Index Cond: (horarioturma = horarioturma_3.codigo)
662. 0.000 0.000 ↓ 0.0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem horarioturmadiaitem_3 (cost=0.42..0.50 rows=2 width=8) (actual rows= loops=)

  • Index Cond: (horarioturmadia = horarioturmadia_3.codigo)
663. 0.000 0.000 ↓ 0.0

Index Scan using matriculaperiodo_pkey on matriculaperiodo matriculaperiodo_5 (cost=0.42..2.64 rows=1 width=22) (actual rows= loops=)

  • Index Cond: (codigo = emptd.matriculaperiodo)
664. 0.000 0.000 ↓ 0.0

Index Scan using matricula_pkey on matricula matricula_5 (cost=0.42..0.47 rows=1 width=25) (actual rows= loops=)

  • Index Cond: ((matricula)::text = (matriculaperiodo_5.matricula)::text)
665. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa aluno_5 (cost=0.42..0.57 rows=1 width=18) (actual rows= loops=)

  • Index Cond: (codigo = matricula_5.aluno)
666. 0.000 0.000 ↓ 0.0

Bitmap Heap Scan on curso curso_5 (cost=6.46..16.03 rows=1 width=4) (actual rows= loops=)

  • Recheck Cond: ((codigo = "*SELECT* 1_2".curso) OR (codigo = (SubPlan 27)))
  • Filter: (((NOT "*SELECT* 1_2".turmaagrupada) AND (codigo = "*SELECT* 1_2".curso)) OR ("*SELECT* 1_2".turmaagrupada AND (codigo = (SubPlan 27))))
667. 0.000 0.000 ↓ 0.0

BitmapOr (cost=6.46..6.46 rows=2 width=0) (actual rows= loops=)

668. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..1.38 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = "*SELECT* 1_2".curso)
669. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..5.08 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 27))
670.          

SubPlan (for Bitmap Heap Scan)

671. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

672. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

673. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_9 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = "*SELECT* 1_2".codigo)
674. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_4 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_9.turma)
675. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_5 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)

  • Index Cond: (codigo = horarioturmadiaitem_3.disciplina)"(cost=6.46..6.46 rows=2 width=0)
676. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..1.38 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = "*SELECT* 1_2".curso)
677. 0.000 0.000 ↓ 0.0

Bitmap Index Scan on curso_pkey (cost=0.00..5.08 rows=1 width=0) (actual rows= loops=)

  • Index Cond: (codigo = (SubPlan 27))
678.          

SubPlan (for Index Only Scan)

679. 0.000 0.000 ↓ 0.0

Limit (cost=0.57..3.69 rows=1 width=4) (actual rows= loops=)

680. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.57..140.99 rows=45 width=4) (actual rows= loops=)

681. 0.000 0.000 ↓ 0.0

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_9 (cost=0.29..35.96 rows=45 width=4) (actual rows= loops=)

  • Index Cond: (turmaorigem = "*SELECT* 1_2".codigo)
682. 0.000 0.000 ↓ 0.0

Index Scan using turma_pkey on turma t_4 (cost=0.29..2.33 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (codigo = turmaagrupada_9.turma)
683. 0.000 0.000 ↓ 0.0

Index Only Scan using disciplina_pkey on disciplina disciplina_5 (cost=0.28..0.30 rows=1 width=4) (actual rows= loops=)