explain.depesz.com

PostgreSQL's explain analyze made readable

Result: U4Wp

Settings
# exclusive inclusive rows x rows loops node
1. 0.063 1,893.690 ↑ 1.1 232 1

Unique (cost=3,574,548.24..3,574,551.53 rows=263 width=61) (actual time=1,893.615..1,893.690 rows=232 loops=1)

2. 0.896 1,893.627 ↑ 1.1 232 1

Sort (cost=3,574,548.24..3,574,548.90 rows=263 width=61) (actual time=1,893.614..1,893.627 rows=232 loops=1)

  • Sort Key: unidadeensino.nome, turma.identificadorturma, turma.codigo, (array_to_string(array_agg(DISTINCT CASE WHEN (gradedisciplinacomposta.disciplina IS NOT NULL) THEN gradedisciplinacomposta.disciplina ELSE CASE WHEN (gdcgd.disciplina IS NOT NULL) THEN gdcgd.disciplina ELSE CASE WHEN (gdcgo.disciplina IS NOT NULL) THEN gdcgo.disciplina ELSE CASE WHEN (gradedisciplina.disciplina IS NOT NULL) THEN gradedisciplina.disciplina ELSE CASE WHEN (gradecurriculargrupooptativadisciplina.disciplina IS NOT NULL) THEN gradecurriculargrupooptativadisciplina.disciplina ELSE 5745 END END END END END), ','::text))
  • Sort Method: quicksort Memory: 43kB
3. 0.575 1,892.731 ↑ 1.1 232 1

GroupAggregate (cost=3,574,531.10..3,574,537.67 rows=263 width=61) (actual time=1,892.154..1,892.731 rows=232 loops=1)

  • Group Key: turma.codigo, unidadeensino.nome
4. 0.390 1,892.156 ↑ 1.1 232 1

Sort (cost=3,574,531.10..3,574,531.75 rows=263 width=49) (actual time=1,892.134..1,892.156 rows=232 loops=1)

  • Sort Key: turma.codigo, unidadeensino.nome
  • Sort Method: quicksort Memory: 43kB
5. 1.055 1,891.766 ↑ 1.1 232 1

Nested Loop (cost=16,169.02..3,574,520.52 rows=263 width=49) (actual time=52.013..1,891.766 rows=232 loops=1)

6. 0.957 237.915 ↓ 5.6 1,481 1

Hash Left Join (cost=3,367.78..207,786.95 rows=263 width=55) (actual time=48.592..237.915 rows=1,481 loops=1)

  • Hash Cond: (unidadeensino.configuracoes = configuracoes.codigo)
7. 1.295 236.936 ↓ 5.6 1,481 1

Hash Left Join (cost=3,365.74..207,781.29 rows=263 width=55) (actual time=48.564..236.936 rows=1,481 loops=1)

  • Hash Cond: (turma.unidadeensino = unidadeensino.codigo)
8. 4.227 235.583 ↓ 5.6 1,481 1

Hash Left Join (cost=3,358.01..207,772.83 rows=263 width=39) (actual time=48.500..235.583 rows=1,481 loops=1)

  • Hash Cond: (vagaturma.codigo = vagaturmadisciplina.vagaturma)
  • Filter: ((((vagaturmadisciplina.codigo IS NOT NULL) AND (vagaturmadisciplina.nrvagasmatriculareposicao IS NOT NULL) AND (vagaturmadisciplina.nrvagasmatriculareposicao > 0)) OR ((vagaturmadisciplina.codigo IS NULL) AND (turma.nrvagasinclusaoreposicao IS NOT NULL) AND (turma.nrvagasinclusaoreposicao > 0))) AND (((SubPlan 8) + (SubPlan 10)) < CASE WHEN (vagaturmadisciplina.nrvagasmatriculareposicao IS NOT NULL) THEN vagaturmadisciplina.nrvagasmatriculareposicao ELSE turma.nrvagasinclusaoreposicao END))
  • Rows Removed by Filter: 22
9. 1.964 112.956 ↓ 1.9 1,503 1

Nested Loop Left Join (cost=2,959.64..207,372.35 rows=804 width=47) (actual time=47.538..112.956 rows=1,503 loops=1)

10. 12.715 106.486 ↓ 1.9 1,502 1

Hash Left Join (cost=2,959.36..207,065.54 rows=804 width=43) (actual time=47.520..106.486 rows=1,502 loops=1)

  • Hash Cond: (gradedisciplina.codigo = gdcgd.gradedisciplina)
  • Join Filter: (NOT (alternatives: SubPlan 1 or hashed SubPlan 2))
  • Filter: (((turmadisciplina.disciplina = 5745) AND (gradedisciplina.cargahoraria = 24)) OR ((turmadisciplina.disciplina = 5745) AND (gradecurriculargrupooptativadisciplina.cargahoraria = 24)) OR ((gdcgd.disciplina = 5745) AND (gdcgd.cargahoraria = 24)) OR ((gdcgo.disciplina = 5745) AND (gdcgo.cargahoraria = 24)) OR ((gradedisciplinacomposta.disciplina = 5745) AND (gradedisciplinacomposta.cargahoraria = 24)))
  • Rows Removed by Filter: 34418
11. 7.274 93.765 ↓ 1.1 35,920 1

Hash Left Join (cost=2,942.16..201,809.25 rows=33,400 width=67) (actual time=47.442..93.765 rows=35,920 loops=1)

  • Hash Cond: (gradecurriculargrupooptativadisciplina.codigo = gdcgo.gradecurriculargrupooptativadisciplina)
  • Join Filter: (NOT (alternatives: SubPlan 3 or hashed SubPlan 4))
12. 7.209 86.485 ↓ 1.1 35,920 1

Hash Left Join (cost=2,924.96..3,149.26 rows=33,400 width=63) (actual time=47.430..86.485 rows=35,920 loops=1)

  • Hash Cond: (turmadisciplina.gradecurriculargrupooptativadisciplina = gradecurriculargrupooptativadisciplina.codigo)
13. 17.856 79.253 ↓ 1.1 35,920 1

Hash Left Join (cost=2,923.44..3,060.07 rows=33,400 width=55) (actual time=47.399..79.253 rows=35,920 loops=1)

  • Hash Cond: (turmadisciplina.gradedisciplina = gradedisciplina.codigo)
14. 14.310 57.899 ↓ 1.1 35,920 1

Hash Right Join (cost=2,511.62..2,560.54 rows=33,400 width=47) (actual time=43.839..57.899 rows=35,920 loops=1)

  • Hash Cond: (turmadisciplinacomposta.turmadisciplina = turmadisciplina.codigo)
15. 0.001 0.026 ↓ 0.0 0 1

Hash Left Join (cost=17.20..50.62 rows=1,850 width=12) (actual time=0.025..0.026 rows=0 loops=1)

  • Hash Cond: (turmadisciplinacomposta.gradedisciplinacomposta = gradedisciplinacomposta.codigo)
16. 0.025 0.025 ↓ 0.0 0 1

Seq Scan on turmadisciplinacomposta (cost=0.00..28.50 rows=1,850 width=8) (actual time=0.025..0.025 rows=0 loops=1)

17. 0.000 0.000 ↓ 0.0 0

Hash (cost=13.20..13.20 rows=320 width=12) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Seq Scan on gradedisciplinacomposta (cost=0.00..13.20 rows=320 width=12) (never executed)

19. 10.282 43.563 ↓ 1.1 35,920 1

Hash (cost=2,076.92..2,076.92 rows=33,400 width=39) (actual time=43.563..43.563 rows=35,920 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3143kB
20. 14.540 33.281 ↓ 1.1 35,920 1

Hash Join (cost=194.41..2,076.92 rows=33,400 width=39) (actual time=2.692..33.281 rows=35,920 loops=1)

  • Hash Cond: (turmadisciplina.turma = turma.codigo)
21. 16.090 16.090 ↓ 1.0 71,795 1

Seq Scan on turmadisciplina (cost=0.00..1,693.89 rows=71,790 width=20) (actual time=0.014..16.090 rows=71,795 loops=1)

  • Filter: permitereposicao
  • Rows Removed by Filter: 394
22. 0.465 2.651 ↓ 1.0 2,226 1

Hash (cost=166.64..166.64 rows=2,222 width=23) (actual time=2.651..2.651 rows=2,226 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 153kB
23. 2.186 2.186 ↓ 1.0 2,226 1

Seq Scan on turma (cost=0.00..166.64 rows=2,222 width=23) (actual time=0.008..2.186 rows=2,226 loops=1)

  • Filter: ((((NOT subturma) AND (NOT turmaagrupada)) OR (subturma AND ((tiposubturma)::text = 'GERAL'::text))) AND ((situacao)::text = 'AB'::text))
  • Rows Removed by Filter: 2550
24. 1.610 3.498 ↑ 1.0 10,392 1

Hash (cost=281.92..281.92 rows=10,392 width=12) (actual time=3.498..3.498 rows=10,392 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 575kB
25. 1.888 1.888 ↑ 1.0 10,392 1

Seq Scan on gradedisciplina (cost=0.00..281.92 rows=10,392 width=12) (actual time=0.010..1.888 rows=10,392 loops=1)

26. 0.006 0.023 ↑ 1.0 23 1

Hash (cost=1.23..1.23 rows=23 width=12) (actual time=0.023..0.023 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
27. 0.017 0.017 ↑ 1.0 23 1

Seq Scan on gradecurriculargrupooptativadisciplina (cost=0.00..1.23 rows=23 width=12) (actual time=0.013..0.017 rows=23 loops=1)

28. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=13.20..13.20 rows=320 width=12) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
29. 0.006 0.006 ↓ 0.0 0 1

Seq Scan on gradedisciplinacomposta gdcgo (cost=0.00..13.20 rows=320 width=12) (actual time=0.006..0.006 rows=0 loops=1)

30.          

SubPlan (for Hash Left Join)

31. 0.000 0.000 ↓ 0.0 0

Seq Scan on turmadisciplinacomposta turmadisciplinacomposta_3 (cost=0.00..33.13 rows=9 width=0) (never executed)

  • Filter: (turmadisciplina = turmadisciplina.codigo)
32. 0.000 0.000 ↓ 0.0 0

Seq Scan on turmadisciplinacomposta turmadisciplinacomposta_4 (cost=0.00..28.50 rows=1,850 width=4) (never executed)

33. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=13.20..13.20 rows=320 width=12) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
34. 0.006 0.006 ↓ 0.0 0 1

Seq Scan on gradedisciplinacomposta gdcgd (cost=0.00..13.20 rows=320 width=12) (actual time=0.006..0.006 rows=0 loops=1)

35.          

SubPlan (for Hash Left Join)

36. 0.000 0.000 ↓ 0.0 0

Seq Scan on turmadisciplinacomposta turmadisciplinacomposta_1 (cost=0.00..33.13 rows=9 width=0) (never executed)

  • Filter: (turmadisciplina = turmadisciplina.codigo)
37. 0.000 0.000 ↓ 0.0 0

Seq Scan on turmadisciplinacomposta turmadisciplinacomposta_2 (cost=0.00..28.50 rows=1,850 width=4) (never executed)

38. 4.506 4.506 ↑ 1.0 1 1,502

Index Scan using ch_vagaturma_turma on vagaturma (cost=0.28..0.37 rows=1 width=10) (actual time=0.003..0.003 rows=1 loops=1,502)

  • Index Cond: (turma = turma.codigo)
  • Filter: ((turma.semestral AND ((ano)::text = ''::text) AND ((semestre)::text = ''::text)) OR (turma.anual AND ((ano)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
39. 0.212 0.532 ↓ 1.0 1,093 1

Hash (cost=384.94..384.94 rows=1,074 width=12) (actual time=0.532..0.532 rows=1,093 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 63kB
40. 0.320 0.320 ↓ 1.0 1,093 1

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina (cost=0.29..384.94 rows=1,074 width=12) (actual time=0.007..0.320 rows=1,093 loops=1)

  • Index Cond: (disciplina = 5745)
41.          

SubPlan (for Hash Left Join)

42. 7.460 95.488 ↑ 1.0 1 1,492

Aggregate (cost=136.19..136.20 rows=1 width=8) (actual time=0.064..0.064 rows=1 loops=1,492)

43. 2.743 88.028 ↓ 0.0 0 1,492

Nested Loop (cost=2.52..136.19 rows=1 width=4) (actual time=0.044..0.059 rows=0 loops=1,492)

  • Join Filter: (((m.gradecurricularatual = h.matrizcurricular) AND ((h.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT h.historicocursandoporcorrespondenciaapostransferencia)) AND ((h.transferenciamatrizcurricularmatricula IS NULL) OR ((h.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 5))))) OR ((m.gradecurricularatual <> h.matrizcurricular) AND h.historicocursandoporcorrespondenciaapostransferencia AND (h.transferenciamatrizcurricularmatricula IS NOT NULL) AND (h.disciplina = (SubPlan 6))) OR ((h.matrizcurricular = mp.gradecurricular) AND (m.gradecurricularatual <> h.matrizcurricular) AND h.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 7))))
  • Rows Removed by Join Filter: 0
44. 5.323 82.060 ↓ 0.0 0 1,492

Nested Loop (cost=2.09..68.85 rows=1 width=16) (actual time=0.041..0.055 rows=0 loops=1,492)

  • Join Filter: (conf.codigo = confg.configuracoes)
45. 0.847 76.092 ↓ 0.0 0 1,492

Nested Loop (cost=2.09..67.83 rows=1 width=24) (actual time=0.038..0.051 rows=0 loops=1,492)

46. 0.202 74.600 ↓ 0.0 0 1,492

Nested Loop (cost=1.97..67.57 rows=1 width=20) (actual time=0.038..0.050 rows=0 loops=1,492)

47. 1.049 73.108 ↓ 0.0 0 1,492

Nested Loop (cost=1.82..67.41 rows=1 width=20) (actual time=0.037..0.049 rows=0 loops=1,492)

48. 1.694 70.124 ↓ 0.0 0 1,492

Nested Loop (cost=1.54..63.10 rows=1 width=24) (actual time=0.036..0.047 rows=0 loops=1,492)

  • Join Filter: CASE WHEN ((c.periodicidade)::text = ANY ('{SE,IN}'::text[])) THEN (((mp.ano)::text = ''::text) AND ((mp.semestre)::text = ''::text)) WHEN ((c.periodicidade)::text = 'AN'::text) THEN ((mp.ano)::text = ''::text) ELSE ((c.periodicidade)::text = 'IN'::text) END
49. 1.414 67.140 ↓ 0.0 0 1,492

Nested Loop (cost=1.27..62.79 rows=1 width=30) (actual time=0.034..0.045 rows=0 loops=1,492)

50. 0.846 56.696 ↓ 0.0 0 1,492

Nested Loop (cost=0.85..62.15 rows=1 width=32) (actual time=0.030..0.038 rows=0 loops=1,492)

51. 52.220 52.220 ↓ 0.0 0 1,492

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd (cost=0.43..53.71 rows=1 width=12) (actual time=0.027..0.035 rows=0 loops=1,492)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5745))
  • Filter: reposicao
  • Rows Removed by Filter: 35
52. 3.630 3.630 ↑ 1.0 1 726

Index Scan using matriculaperiodo_pkey on matriculaperiodo mp (cost=0.42..8.44 rows=1 width=24) (actual time=0.005..0.005 rows=1 loops=726)

  • Index Cond: (codigo = mptd.matriculaperiodo)
  • Filter: ((situacaomatriculaperiodo)::text = ANY ('{AT,PR,CO}'::text[]))
  • Rows Removed by Filter: 0
53. 9.030 9.030 ↑ 1.0 1 645

Index Scan using matricula_pkey on matricula m (cost=0.42..0.63 rows=1 width=26) (actual time=0.014..0.014 rows=1 loops=645)

  • Index Cond: ((matricula)::text = (mp.matricula)::text)
  • Filter: ((situacao)::text = 'AT'::text)
54. 1.290 1.290 ↑ 1.0 1 645

Index Scan using curso_pkey on curso c (cost=0.27..0.29 rows=1 width=7) (actual time=0.002..0.002 rows=1 loops=645)

  • Index Cond: (codigo = m.curso)
55. 1.935 1.935 ↑ 1.0 1 645

Index Only Scan using turma_pkey on turma t_5 (cost=0.28..4.30 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=645)

  • Index Cond: (codigo = turma.codigo)
  • Heap Fetches: 0
56. 1.290 1.290 ↑ 1.0 1 645

Index Scan using unidadeensino_pkey on unidadeensino ue (cost=0.14..0.16 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=645)

  • Index Cond: (codigo = m.unidadeensino)
57. 0.645 0.645 ↑ 1.0 1 645

Index Only Scan using configuracoes_pkey on configuracoes conf (cost=0.13..0.25 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=645)

  • Index Cond: (codigo = ue.configuracoes)
  • Heap Fetches: 0
58. 0.645 0.645 ↑ 1.0 1 645

Seq Scan on configuracaogeralsistema confg (cost=0.00..1.01 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=645)

59. 3.225 3.225 ↑ 1.0 1 645

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico h (cost=0.43..8.45 rows=1 width=38) (actual time=0.005..0.005 rows=1 loops=645)

  • Index Cond: (matriculaperiodoturmadisciplina = mptd.codigo)
60.          

SubPlan (for Nested Loop)

61. 0.000 0.000 ↓ 0.0 0

Limit (cost=24.19..28.22 rows=1 width=4) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his (cost=24.19..28.22 rows=1 width=4) (never executed)

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

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

64. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (h.matricula)::text)
65. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (disciplina = h.disciplina)
66. 0.000 0.000 ↓ 0.0 0

Limit (cost=24.19..28.22 rows=1 width=4) (never executed)

67. 0.000 0.000 ↓ 0.0 0

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

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

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

69. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (h.matricula)::text)
70. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (disciplina = h.disciplina)
71. 0.000 0.000 ↓ 0.0 0

Index Only Scan using unq_historico_disciplina_matrper_matrperturm_grade_gd_gcgod on historico his_2 (cost=0.43..8.45 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = h.disciplina) AND (matriculaperiodo = h.matriculaperiodo) AND (matrizcurricular = m.gradecurricularatual))
  • Heap Fetches: 0
72. 1.492 22.380 ↑ 1.0 1 1,492

Aggregate (cost=124.66..124.67 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=1,492)

73. 0.000 20.888 ↓ 0.0 0 1,492

Nested Loop Left Join (cost=2.39..124.65 rows=1 width=4) (actual time=0.014..0.014 rows=0 loops=1,492)

  • Join Filter: requerimento.disciplinaporequivalencia
  • Filter: ((requerimento.disciplina = 5745) OR (mapaequivalenciadisciplinacursada.disciplina = 5745))
74. 1.492 20.888 ↓ 0.0 0 1,492

Nested Loop Left Join (cost=2.11..116.34 rows=1 width=13) (actual time=0.014..0.014 rows=0 loops=1,492)

  • Filter: (((requerimento.situacaofinanceira)::text = 'IS'::text) OR (contareceber.codigo IS NULL) OR (contareceber.datavencimento <= CURRENT_DATE))
75. 0.000 19.396 ↓ 0.0 0 1,492

Nested Loop (cost=1.68..107.88 rows=1 width=20) (actual time=0.013..0.013 rows=0 loops=1,492)

  • Join Filter: (((turmareposicao.semestral AND ((matper.ano)::text = ''::text) AND ((matper.semestre)::text = ''::text)) OR (turmareposicao.anual AND ((matper.ano)::text = ''::text)) OR ((NOT turmareposicao.anual) AND (NOT turmareposicao.semestral))) AND CASE WHEN (requerimento.matriculaperiodo IS NOT NULL) THEN (requerimento.matriculaperiodo = matper.codigo) ELSE CASE WHEN (requerimento.codigo <> 0) THEN (matper.turma = requerimento.turma) ELSE (matper.codigo = (SubPlan 9)) END END)
76. 0.000 19.396 ↓ 0.0 0 1,492

Nested Loop (cost=1.26..98.77 rows=1 width=57) (actual time=0.013..0.013 rows=0 loops=1,492)

77. 0.000 19.396 ↓ 0.0 0 1,492

Nested Loop (cost=0.84..90.33 rows=1 width=43) (actual time=0.013..0.013 rows=0 loops=1,492)

78. 1.492 19.396 ↓ 0.0 0 1,492

Nested Loop (cost=0.56..82.02 rows=1 width=45) (actual time=0.013..0.013 rows=0 loops=1,492)

79. 17.904 17.904 ↓ 0.0 0 1,492

Index Scan using idx_requerimento_turmareposicao on requerimento (cost=0.42..68.51 rows=1 width=49) (actual time=0.012..0.012 rows=0 loops=1,492)

  • Index Cond: (turmareposicao = turma.codigo)
  • Filter: ((situacao)::text <> ALL ('{FD,FI}'::text[]))
  • Rows Removed by Filter: 9
80. 0.000 0.000 ↓ 0.0 0

Index Scan using tiporequerimento_pkey on tiporequerimento (cost=0.14..8.16 rows=1 width=4) (never executed)

  • Index Cond: (codigo = requerimento.tiporequerimento)
  • Filter: ((tipo)::text = 'RE'::text)
81. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma turmareposicao (cost=0.28..8.30 rows=1 width=6) (never executed)

  • Index Cond: (codigo = turma.codigo)
82. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula mat (cost=0.42..8.44 rows=1 width=14) (never executed)

  • Index Cond: ((matricula)::text = (requerimento.matricula)::text)
  • Filter: ((situacao)::text = 'AT'::text)
83. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_matriculaperiodo_matricula on matriculaperiodo matper (cost=0.42..0.62 rows=1 width=24) (never executed)

  • Index Cond: ((matricula)::text = (mat.matricula)::text)
  • Filter: ((situacaomatriculaperiodo)::text = ANY ('{AT,PR}'::text[]))
84.          

SubPlan (for Nested Loop)

85. 0.000 0.000 ↓ 0.0 0

Limit (cost=8.45..8.46 rows=1 width=40) (never executed)

86. 0.000 0.000 ↓ 0.0 0

Sort (cost=8.45..8.46 rows=1 width=40) (never executed)

  • Sort Key: ((((mp_1.ano)::text || '/'::text) || (mp_1.semestre)::text)) DESC, mp_1.periodoletivomatricula DESC
87. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (requerimento.matricula)::text)
88. 0.000 0.000 ↓ 0.0 0

Index Scan using contareceber_pkey on contareceber (cost=0.43..8.45 rows=1 width=12) (never executed)

  • Index Cond: (codigo = requerimento.contareceber)
89. 0.000 0.000 ↓ 0.0 0

Index Scan using pk_mapaequivalenciadisciplinacursada_codigo on mapaequivalenciadisciplinacursada (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Index Cond: (codigo = requerimento.mapaequivalenciadisciplinacursada)
90. 0.017 0.058 ↑ 1.0 77 1

Hash (cost=6.77..6.77 rows=77 width=24) (actual time=0.058..0.058 rows=77 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
91. 0.041 0.041 ↑ 1.0 77 1

Seq Scan on unidadeensino (cost=0.00..6.77 rows=77 width=24) (actual time=0.009..0.041 rows=77 loops=1)

92. 0.004 0.022 ↑ 1.0 1 1

Hash (cost=2.03..2.03 rows=1 width=8) (actual time=0.022..0.022 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
93. 0.003 0.018 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.00..2.03 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1)

  • Join Filter: (configuracaogeralsistema.configuracoes = configuracoes.codigo)
94. 0.008 0.008 ↑ 1.0 1 1

Seq Scan on configuracoes (cost=0.00..1.01 rows=1 width=4) (actual time=0.008..0.008 rows=1 loops=1)

95. 0.007 0.007 ↑ 1.0 1 1

Seq Scan on configuracaogeralsistema (cost=0.00..1.01 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=1)

96. 2.962 1,652.796 ↓ 0.0 0 1,481

Limit (cost=12,801.24..12,801.25 rows=1 width=4) (actual time=1.115..1.116 rows=0 loops=1,481)

97. 2.962 1,649.834 ↓ 0.0 0 1,481

HashAggregate (cost=12,801.24..12,804.27 rows=303 width=4) (actual time=1.114..1.114 rows=0 loops=1,481)

  • Group Key: ht.turma
98. 5.924 1,646.872 ↓ 0.0 0 1,481

Append (cost=1.12..12,800.48 rows=303 width=4) (actual time=0.932..1.112 rows=0 loops=1,481)

99. 1.481 182.163 ↓ 0.0 0 1,481

Unique (cost=1.12..62.60 rows=1 width=4) (actual time=0.099..0.123 rows=0 loops=1,481)

100. 6.331 180.682 ↑ 1.0 1 1,481

Nested Loop (cost=1.12..62.60 rows=1 width=4) (actual time=0.098..0.122 rows=1 loops=1,481)

101. 3.798 119.961 ↑ 1.3 12 1,481

Nested Loop (cost=0.70..50.10 rows=16 width=8) (actual time=0.040..0.081 rows=12 loops=1,481)

102. 4.443 4.443 ↑ 1.0 1 1,481

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht (cost=0.28..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=1,481)

  • Index Cond: (turma = turma.codigo)
  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
103. 111.720 111.720 ↓ 1.1 19 931

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd (cost=0.42..41.61 rows=18 width=8) (actual time=0.059..0.120 rows=19 loops=931)

  • Index Cond: (horarioturma = ht.codigo)
  • Filter: (data >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval))
  • Rows Removed by Filter: 38
104. 54.390 54.390 ↓ 0.0 0 18,130

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi (cost=0.42..0.77 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=18,130)

  • Index Cond: (horarioturmadia = htd.codigo)
  • Filter: ((disciplina = 5745) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
  • Rows Removed by Filter: 1
105. 1.481 20.734 ↓ 0.0 0 1,481

Unique (cost=39.73..39.74 rows=1 width=4) (actual time=0.014..0.014 rows=0 loops=1,481)

106. 2.962 19.253 ↓ 0.0 0 1,481

Sort (cost=39.73..39.73 rows=1 width=4) (actual time=0.013..0.013 rows=0 loops=1,481)

  • Sort Key: t.codigo
  • Sort Method: quicksort Memory: 25kB
107. 0.000 16.291 ↓ 0.0 0 1,481

Nested Loop (cost=5.45..39.72 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=1,481)

108. 0.000 16.291 ↓ 0.0 0 1,481

Nested Loop (cost=5.03..27.22 rows=16 width=8) (actual time=0.011..0.011 rows=0 loops=1,481)

109. 11.848 16.291 ↓ 0.0 0 1,481

Nested Loop (cost=4.59..23.07 rows=1 width=8) (actual time=0.011..0.011 rows=0 loops=1,481)

110. 0.000 4.443 ↓ 0.0 0 1,481

Bitmap Heap Scan on turma t (cost=4.31..14.75 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=1,481)

  • Recheck Cond: (turmaprincipal = turma.codigo)
  • Filter: (subturma AND (NOT turmaagrupada) AND ((situacao)::text = 'AB'::text))
111. 4.443 4.443 ↓ 0.0 0 1,481

Bitmap Index Scan on idx_turma_turmaprincipal (cost=0.00..4.30 rows=3 width=0) (actual time=0.003..0.003 rows=0 loops=1,481)

  • Index Cond: (turmaprincipal = turma.codigo)
112. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_1 (cost=0.28..8.30 rows=1 width=8) (never executed)

  • Index Cond: (turma = t.codigo)
  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
113. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_1 (cost=0.44..3.97 rows=18 width=8) (never executed)

  • Index Cond: ((horarioturma = ht_1.codigo) AND (data >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval)))
114. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_1 (cost=0.42..0.77 rows=1 width=4) (never executed)

  • Index Cond: (horarioturmadia = htd_1.codigo)
  • Filter: ((disciplina = 5745) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
115. 1.481 14.810 ↓ 0.0 0 1,481

Unique (cost=119.92..119.93 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1,481)

116. 1.481 13.329 ↓ 0.0 0 1,481

Sort (cost=119.92..119.92 rows=1 width=4) (actual time=0.009..0.009 rows=0 loops=1,481)

  • Sort Key: t_1.codigo
  • Sort Method: quicksort Memory: 25kB
117. 1.481 11.848 ↓ 0.0 0 1,481

Nested Loop (cost=5.65..119.91 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=1,481)

118. 0.000 10.367 ↓ 0.0 0 1,481

Nested Loop (cost=5.23..94.13 rows=33 width=8) (actual time=0.007..0.007 rows=0 loops=1,481)

119. 0.000 10.367 ↓ 0.0 0 1,481

Nested Loop (cost=4.79..85.82 rows=2 width=8) (actual time=0.007..0.007 rows=0 loops=1,481)

120. 7.405 10.367 ↓ 0.0 0 1,481

Nested Loop (cost=4.51..81.94 rows=8 width=12) (actual time=0.007..0.007 rows=0 loops=1,481)

121. 1.481 2.962 ↓ 0.0 0 1,481

Bitmap Heap Scan on turmaagrupada (cost=4.23..14.79 rows=10 width=4) (actual time=0.002..0.002 rows=0 loops=1,481)

  • Recheck Cond: (turma = turma.codigo)
122. 1.481 1.481 ↓ 0.0 0 1,481

Bitmap Index Scan on idx_turmaagrupada_turma (cost=0.00..4.23 rows=10 width=0) (actual time=0.001..0.001 rows=0 loops=1,481)

  • Index Cond: (turma = turma.codigo)
123. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_2 (cost=0.28..6.70 rows=1 width=8) (never executed)

  • Index Cond: (turma = turmaagrupada.turmaorigem)
  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
124. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma t_1 (cost=0.28..0.49 rows=1 width=4) (never executed)

  • Index Cond: (codigo = ht_2.turma)
  • Filter: ((situacao)::text = 'AB'::text)
125. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_2 (cost=0.44..3.97 rows=18 width=8) (never executed)

  • Index Cond: ((horarioturma = ht_2.codigo) AND (data >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval)))
126. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_2 (cost=0.42..0.77 rows=1 width=4) (never executed)

  • Index Cond: (horarioturmadia = htd_2.codigo)
  • Filter: ((disciplina = 5745) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
127. 0.000 28.139 ↓ 0.0 0 1,481

Unique (cost=122.29..122.29 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=1,481)

128. 2.962 28.139 ↓ 0.0 0 1,481

Sort (cost=122.29..122.29 rows=1 width=4) (actual time=0.019..0.019 rows=0 loops=1,481)

  • Sort Key: t_2.codigo
  • Sort Method: quicksort Memory: 25kB
129. 2.962 25.177 ↓ 0.0 0 1,481

Hash Join (cost=8.03..122.28 rows=1 width=4) (actual time=0.017..0.017 rows=0 loops=1,481)

  • Hash Cond: (htdi_3.disciplina = de.equivalente)
130. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.65..119.58 rows=50 width=8) (never executed)

131. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.23..94.13 rows=33 width=8) (never executed)

132. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.79..85.82 rows=2 width=8) (never executed)

133. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.51..81.94 rows=8 width=12) (never executed)

134. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_1 (cost=4.23..14.79 rows=10 width=4) (never executed)

  • Recheck Cond: (turma = turma.codigo)
135. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_turmaagrupada_turma (cost=0.00..4.23 rows=10 width=0) (never executed)

  • Index Cond: (turma = turma.codigo)
136. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_3 (cost=0.28..6.70 rows=1 width=8) (never executed)

  • Index Cond: (turma = turmaagrupada_1.turmaorigem)
  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
137. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma t_2 (cost=0.28..0.49 rows=1 width=4) (never executed)

  • Index Cond: (codigo = ht_3.turma)
  • Filter: ((situacao)::text = 'AB'::text)
138. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_3 (cost=0.44..3.97 rows=18 width=8) (never executed)

  • Index Cond: ((horarioturma = ht_3.codigo) AND (data >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval)))
139. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_3 (cost=0.42..0.75 rows=2 width=8) (never executed)

  • Index Cond: (horarioturmadia = htd_3.codigo)
140. 7.405 22.215 ↓ 0.0 0 1,481

Hash (cost=2.30..2.30 rows=6 width=4) (actual time=0.015..0.015 rows=0 loops=1,481)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
141. 14.810 14.810 ↓ 0.0 0 1,481

Seq Scan on disciplinaequivalente de (cost=0.00..2.30 rows=6 width=4) (actual time=0.010..0.010 rows=0 loops=1,481)

  • Filter: ((disciplina = 5745) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
  • Rows Removed by Filter: 65
142. 0.000 14.810 ↓ 0.0 0 1,481

Unique (cost=36.73..36.74 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1,481)

143. 2.962 14.810 ↓ 0.0 0 1,481

Sort (cost=36.73..36.73 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=1,481)

  • Sort Key: t_3.codigo
  • Sort Method: quicksort Memory: 25kB
144. 0.000 11.848 ↓ 0.0 0 1,481

Nested Loop (cost=10.10..36.72 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=1,481)

145. 0.000 11.848 ↓ 0.0 0 1,481

Nested Loop (cost=9.96..36.21 rows=3 width=8) (actual time=0.008..0.008 rows=0 loops=1,481)

146. 0.000 11.848 ↓ 0.0 0 1,481

Nested Loop (cost=9.54..34.67 rows=2 width=8) (actual time=0.008..0.008 rows=0 loops=1,481)

147. 1.481 11.848 ↓ 0.0 0 1,481

Nested Loop (cost=9.10..30.52 rows=1 width=8) (actual time=0.008..0.008 rows=0 loops=1,481)

148. 0.000 10.367 ↓ 0.0 0 1,481

Nested Loop (cost=8.82..30.03 rows=1 width=12) (actual time=0.007..0.007 rows=0 loops=1,481)

149. 5.924 10.367 ↓ 0.0 0 1,481

Nested Loop (cost=8.54..29.64 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=1,481)

150. 1.481 4.443 ↓ 0.0 0 1,481

Bitmap Heap Scan on turma tsub (cost=4.31..14.76 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=1,481)

  • Recheck Cond: (turmaprincipal = turma.codigo)
  • Filter: (subturma AND ((tiposubturma)::text = ANY ('{PRATICA,TEORICA}'::text[])) AND ((situacao)::text = 'AB'::text))
151. 2.962 2.962 ↓ 0.0 0 1,481

Bitmap Index Scan on idx_turma_turmaprincipal (cost=0.00..4.30 rows=3 width=0) (actual time=0.002..0.002 rows=0 loops=1,481)

  • Index Cond: (turmaprincipal = turma.codigo)
152. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_2 (cost=4.23..14.79 rows=10 width=8) (never executed)

  • Recheck Cond: (turma = tsub.codigo)
153. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_turmaagrupada_turma (cost=0.00..4.23 rows=10 width=0) (never executed)

  • Index Cond: (turma = tsub.codigo)
154. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_4 (cost=0.28..0.38 rows=1 width=8) (never executed)

  • Index Cond: (turma = turmaagrupada_2.turmaorigem)
  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
155. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma t_3 (cost=0.28..0.49 rows=1 width=4) (never executed)

  • Index Cond: (codigo = ht_4.turma)
  • Filter: ((situacao)::text = 'AB'::text)
156. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_4 (cost=0.44..3.97 rows=18 width=8) (never executed)

  • Index Cond: ((horarioturma = ht_4.codigo) AND (data >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval)))
157. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_4 (cost=0.42..0.75 rows=2 width=8) (never executed)

  • Index Cond: (horarioturmadia = htd_4.codigo)
158. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((disciplina = 5745) AND (equivalente = htdi_4.disciplina))
  • Heap Fetches: 0
159. 2.962 1,325.495 ↓ 0.0 0 1,481

Hash Join (cost=3,785.35..12,355.58 rows=297 width=4) (actual time=0.895..0.895 rows=0 loops=1,481)

  • Hash Cond: (htd_5.horarioturma = ht_5.codigo)
  • Join Filter: (SubPlan 11)
160. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=3,455.01..7,149.76 rows=3,824 width=12) (never executed)

  • Hash Cond: (htd_5.codigo = htdi_5.horarioturmadia)
161. 0.000 0.000 ↓ 0.0 0

Seq Scan on horarioturmadia htd_5 (cost=0.00..2,894.67 rows=152,367 width=16) (never executed)

162. 0.000 0.000 ↓ 0.0 0

Hash (cost=3,407.21..3,407.21 rows=3,824 width=4) (never executed)

163. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on horarioturmadiaitem htdi_5 (cost=74.06..3,407.21 rows=3,824 width=4) (never executed)

  • Recheck Cond: (disciplina = 5745)
164. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_horturdiaitem_disciplina (cost=0.00..73.10 rows=3,824 width=0) (never executed)

  • Index Cond: (disciplina = 5745)
165. 0.000 1,322.533 ↓ 0.0 0 1,481

Hash (cost=324.31..324.31 rows=482 width=12) (actual time=0.893..0.893 rows=0 loops=1,481)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
166. 309.498 1,322.533 ↓ 0.0 0 1,481

Hash Join (cost=230.17..324.31 rows=482 width=12) (actual time=0.893..0.893 rows=0 loops=1,481)

  • Hash Cond: (ht_5.turma = t_4.codigo)
167. 1,013.004 1,013.004 ↓ 1.3 3,098 1,481

Seq Scan on horarioturma ht_5 (cost=0.00..80.25 rows=2,420 width=8) (actual time=0.002..0.684 rows=3,098 loops=1,481)

  • Filter: ((turma.semestral AND ((anovigente)::text = ''::text) AND ((semestrevigente)::text = ''::text)) OR (turma.anual AND ((anovigente)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual)))
168. 0.000 0.031 ↓ 0.0 0 1

Hash (cost=218.28..218.28 rows=951 width=12) (actual time=0.022..0.031 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
169. 0.008 0.034 ↓ 0.0 0 1

Hash Join (cost=182.52..218.28 rows=951 width=12) (actual time=0.021..0.034 rows=0 loops=1)

  • Hash Cond: (turmaagrupada_3.turmaorigem = t_4.codigo)
170. 0.026 0.026 ↓ 0.0 0 1

Seq Scan on turmaagrupada turmaagrupada_3 (cost=0.00..30.40 rows=2,040 width=8) (actual time=0.020..0.026 rows=0 loops=1)

171. 0.000 0.000 ↓ 0.0 0

Hash (cost=154.70..154.70 rows=2,226 width=4) (never executed)

172. 0.000 0.000 ↓ 0.0 0

Seq Scan on turma t_4 (cost=0.00..154.70 rows=2,226 width=4) (never executed)

  • Filter: ((situacao)::text = 'AB'::text)
173.          

SubPlan (for Hash Join)

174. 0.000 0.000 ↓ 0.0 0

Result (cost=0.28..16.03 rows=1 width=4) (never executed)

  • One-Time Filter: (htd_5.data >= (CURRENT_DATE + (((CASE WHEN ($36 > 0) THEN $36 ELSE 0 END)::text || ' days'::text))::interval))
175. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turma_turmaprincipal on turma tsub_1 (cost=0.28..16.03 rows=1 width=4) (never executed)

  • Index Cond: (turmaprincipal = $35)
  • Filter: (subturma AND ((tiposubturma)::text = ANY ('{PRATICA,TEORICA}'::text[])) AND ((situacao)::text = 'AB'::text))
176. 1.481 54.797 ↓ 0.0 0 1,481

Nested Loop (cost=0.57..59.06 rows=1 width=4) (actual time=0.037..0.037 rows=0 loops=1,481)

177. 53.316 53.316 ↓ 0.0 0 1,481

Index Scan using unique_programacaotutoriaonline on programacaotutoriaonline (cost=0.28..50.74 rows=1 width=8) (actual time=0.036..0.036 rows=0 loops=1,481)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5745))
  • Filter: ((definirperiodoaulaonline IS TRUE) AND ((turma.semestral AND ((ano)::text = ''::text) AND ((semestre)::text = ''::text)) OR (turma.anual AND ((ano)::text = ''::text)) OR ((NOT turma.semestral) AND (NOT turma.anual))) AND (datainicioaula >= (CURRENT_DATE + (((CASE WHEN (configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao > 0) THEN configuracaogeralsistema.qtddiasmaximoantecedenciaremarcaraulareposicao ELSE 0 END)::text || ' days'::text))::interval)))
178. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina turmadisciplina_1 (cost=0.29..8.32 rows=1 width=8) (never executed)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5745))
  • Filter: (((modalidadedisciplina)::text = 'ON_LINE'::text) AND ((definicoestutoriaonline)::text = 'DINAMICA'::text))
Planning time : 24.441 ms
Execution time : 1,895.774 ms