explain.depesz.com

PostgreSQL's explain analyze made readable

Result: cLMv

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 458,130.975 ↓ 0.0 0 1

Unique (cost=1,643,603.07..1,643,615.15 rows=604 width=234) (actual time=458,130.975..458,130.975 rows=0 loops=1)

2. 0.047 458,130.974 ↓ 0.0 0 1

Sort (cost=1,643,603.07..1,643,604.58 rows=604 width=234) (actual time=458,130.974..458,130.974 rows=0 loops=1)

  • Sort Key: ((unidadeensino.nome)::text), ((turma.identificadorturma)::text), 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 5730 END END END END END), ','::text)), (((CASE WHEN (vagaturmadisciplina.nrvagasmatriculareposicao IS NOT NULL) THEN vagaturmadisciplina.nrvagasmatriculareposicao ELSE turma.nrvagasinclusaoreposicao END - ((SubPlan 4) + (SubPlan 6))))::integer), curso.nome, (COALESCE(concat(cidade.nome, '-', estado.sigla), ''::text))
  • Sort Method: quicksort Memory: 25kB
3. 0.004 458,130.927 ↓ 0.0 0 1

GroupAggregate (cost=1,467,342.34..1,643,575.17 rows=604 width=234) (actual time=458,130.927..458,130.927 rows=0 loops=1)

  • Group Key: turma.codigo, unidadeensino.nome, vagaturmadisciplina.nrvagasmatriculareposicao, curso.nome, cidade.nome, estado.sigla
4. 0.010 458,130.923 ↓ 0.0 0 1

Sort (cost=1,467,342.34..1,467,343.85 rows=604 width=126) (actual time=458,130.923..458,130.923 rows=0 loops=1)

  • Sort Key: turma.codigo, unidadeensino.nome, vagaturmadisciplina.nrvagasmatriculareposicao, curso.nome, cidade.nome, estado.sigla
  • Sort Method: quicksort Memory: 25kB
5. 0.001 458,130.913 ↓ 0.0 0 1

Hash Left Join (cost=8,116.38..1,467,314.44 rows=604 width=126) (actual time=458,130.913..458,130.913 rows=0 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 14) + (SubPlan 16)) < CASE WHEN (vagaturmadisciplina.nrvagasmatriculareposicao IS NOT NULL) THEN vagaturmadisciplina.nrvagasmatriculareposicao ELSE turma.nrvagasinclusaoreposicao END))
6. 0.000 458,130.912 ↓ 0.0 0 1

Nested Loop Left Join (cost=7,397.93..1,466,591.23 rows=1,813 width=126) (actual time=458,130.912..458,130.912 rows=0 loops=1)

7. 18.220 458,130.912 ↓ 0.0 0 1

Hash Left Join (cost=7,397.64..1,465,955.38 rows=1,813 width=124) (actual time=458,130.912..458,130.912 rows=0 loops=1)

  • Hash Cond: (unidadeensino.configuracoes = configuracoes.codigo)
  • Filter: ((SubPlan 17) OR (SubPlan 18) OR (SubPlan 19) OR (SubPlan 20) OR (SubPlan 21) OR (SubPlan 23) OR (SubPlan 24))
  • Rows Removed by Filter: 936
8. 8.711 378.711 ↑ 2.0 936 1

Nested Loop Left Join (cost=7,395.60..619,916.95 rows=1,827 width=128) (actual time=223.213..378.711 rows=936 loops=1)

  • Join Filter: (unidadeensino.codigo = turma.unidadeensino)
  • Rows Removed by Join Filter: 73,008
9. 35.062 360.640 ↑ 2.0 936 1

Hash Left Join (cost=7,383.02..617,459.32 rows=1,827 width=91) (actual time=223.030..360.640 rows=936 loops=1)

  • Hash Cond: (gradecurriculargrupooptativadisciplina.codigo = gdcgo.gradecurriculargrupooptativadisciplina)
  • Join Filter: (NOT (alternatives: SubPlan 9 or hashed SubPlan 10))
  • Filter: (((turmadisciplina.disciplina = 5,730) AND (gradedisciplina.cargahoraria = 24)) OR ((turmadisciplina.disciplina = 5,730) AND (gradecurriculargrupooptativadisciplina.cargahoraria = 24)) OR ((gdcgd.disciplina = 5,730) AND (gdcgd.cargahoraria = 24)) OR ((gdcgo.disciplina = 5,730) AND (gdcgo.cargahoraria = 24)) OR ((gradedisciplinacomposta.disciplina = 5,730) AND (gradedisciplinacomposta.cargahoraria = 24)))
  • Rows Removed by Filter: 98,115
10. 26.085 325.573 ↑ 1.0 99,051 1

Hash Left Join (cost=7,365.82..18,097.02 rows=100,101 width=115) (actual time=221.486..325.573 rows=99,051 loops=1)

  • Hash Cond: (turmadisciplina.gradecurriculargrupooptativadisciplina = gradecurriculargrupooptativadisciplina.codigo)
11. 34.572 299.457 ↑ 1.0 99,051 1

Hash Join (cost=7,364.28..17,832.72 rows=100,101 width=107) (actual time=221.440..299.457 rows=99,051 loops=1)

  • Hash Cond: (turma.curso = curso.codigo)
12. 43.838 264.568 ↑ 1.0 99,051 1

Hash Right Join (cost=7,330.69..17,534.23 rows=100,101 width=64) (actual time=221.108..264.568 rows=99,051 loops=1)

  • Hash Cond: (gdcgd.gradedisciplina = gradedisciplina.codigo)
  • Join Filter: (NOT (alternatives: SubPlan 7 or hashed SubPlan 8))
13. 0.022 0.022 ↓ 0.0 0 1

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

14. 32.027 220.708 ↑ 1.0 99,051 1

Hash (cost=6,079.43..6,079.43 rows=100,101 width=60) (actual time=220.708..220.708 rows=99,051 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 9,877kB
15. 33.883 188.681 ↑ 1.0 99,051 1

Hash Left Join (cost=5,762.70..6,079.43 rows=100,101 width=60) (actual time=121.084..188.681 rows=99,051 loops=1)

  • Hash Cond: (turmadisciplina.gradedisciplina = gradedisciplina.codigo)
16. 34.203 150.329 ↑ 1.0 99,051 1

Hash Right Join (cost=5,301.54..5,355.41 rows=100,101 width=52) (actual time=116.557..150.329 rows=99,051 loops=1)

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

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

  • Hash Cond: (turmadisciplinacomposta.gradedisciplinacomposta = gradedisciplinacomposta.codigo)
18. 0.021 0.021 ↓ 0.0 0 1

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

19. 0.000 0.000 ↓ 0.0 0

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

20. 0.000 0.000 ↓ 0.0 0

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

21. 32.564 116.104 ↑ 1.0 99,051 1

Hash (cost=4,033.08..4,033.08 rows=100,101 width=44) (actual time=116.104..116.104 rows=99,051 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 9,103kB
22. 38.607 83.540 ↑ 1.0 99,051 1

Hash Join (cost=462.20..4,033.08 rows=100,101 width=44) (actual time=8.183..83.540 rows=99,051 loops=1)

  • Hash Cond: (turmadisciplina.turma = turma.codigo)
23. 36.815 36.815 ↑ 1.0 136,640 1

Seq Scan on turmadisciplina (cost=0.00..3,212.02 rows=136,650 width=20) (actual time=0.012..36.815 rows=136,640 loops=1)

  • Filter: permitereposicao
  • Rows Removed by Filter: 462
24. 1.904 8.118 ↑ 1.0 7,445 1

Hash (cost=368.88..368.88 rows=7,466 width=28) (actual time=8.118..8.118 rows=7,445 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 513kB
25. 6.214 6.214 ↑ 1.0 7,445 1

Seq Scan on turma (cost=0.00..368.88 rows=7,466 width=28) (actual time=0.011..6.214 rows=7,445 loops=1)

  • Filter: ((((NOT subturma) AND (NOT turmaagrupada)) OR (subturma AND ((tiposubturma)::text = 'GERAL'::text))) AND ((situacao)::text = 'AB'::text))
  • Rows Removed by Filter: 2,747
26. 1.825 4.469 ↑ 1.0 11,607 1

Hash (cost=316.07..316.07 rows=11,607 width=12) (actual time=4.469..4.469 rows=11,607 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 627kB
27. 2.644 2.644 ↑ 1.0 11,607 1

Seq Scan on gradedisciplina (cost=0.00..316.07 rows=11,607 width=12) (actual time=0.017..2.644 rows=11,607 loops=1)

28.          

SubPlan (for Hash Right Join)

29. 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)
30. 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)

31. 0.107 0.317 ↑ 1.0 515 1

Hash (cost=27.15..27.15 rows=515 width=51) (actual time=0.317..0.317 rows=515 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 51kB
32. 0.210 0.210 ↑ 1.0 515 1

Seq Scan on curso (cost=0.00..27.15 rows=515 width=51) (actual time=0.014..0.210 rows=515 loops=1)

33. 0.011 0.031 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=12) (actual time=0.031..0.031 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
34. 0.020 0.020 ↑ 1.0 24 1

Seq Scan on gradecurriculargrupooptativadisciplina (cost=0.00..1.24 rows=24 width=12) (actual time=0.012..0.020 rows=24 loops=1)

35. 0.000 0.005 ↓ 0.0 0 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
36. 0.005 0.005 ↓ 0.0 0 1

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

37.          

SubPlan (for Hash Left Join)

38. 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)
39. 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)

40. 7.165 9.360 ↑ 1.0 79 936

Materialize (cost=12.58..292.83 rows=79 width=45) (actual time=0.000..0.010 rows=79 loops=936)

41. 0.041 2.195 ↑ 1.0 79 1

Hash Left Join (cost=12.58..292.44 rows=79 width=45) (actual time=0.172..2.195 rows=79 loops=1)

  • Hash Cond: (cidade.estado = estado.codigo)
42. 0.458 2.122 ↑ 1.0 79 1

Merge Right Join (cost=10.56..290.19 rows=79 width=47) (actual time=0.129..2.122 rows=79 loops=1)

  • Merge Cond: (cidade.codigo = unidadeensino.cidade)
43. 1.544 1.544 ↑ 1.9 5,614 1

Index Scan using cidade_pkey on cidade (cost=0.29..499.35 rows=10,636 width=27) (actual time=0.018..1.544 rows=5,614 loops=1)

44. 0.051 0.120 ↑ 1.0 79 1

Sort (cost=10.28..10.48 rows=79 width=28) (actual time=0.107..0.120 rows=79 loops=1)

  • Sort Key: unidadeensino.cidade
  • Sort Method: quicksort Memory: 31kB
45. 0.069 0.069 ↑ 1.0 79 1

Seq Scan on unidadeensino (cost=0.00..7.79 rows=79 width=28) (actual time=0.014..0.069 rows=79 loops=1)

46. 0.014 0.032 ↑ 1.0 45 1

Hash (cost=1.45..1.45 rows=45 width=6) (actual time=0.032..0.032 rows=45 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
47. 0.018 0.018 ↑ 1.0 45 1

Seq Scan on estado (cost=0.00..1.45 rows=45 width=6) (actual time=0.010..0.018 rows=45 loops=1)

48. 0.006 0.029 ↑ 1.0 1 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
49. 0.009 0.023 ↑ 1.0 1 1

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

  • Join Filter: (configuracaogeralsistema.configuracoes = configuracoes.codigo)
50. 0.007 0.007 ↑ 1.0 1 1

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

51. 0.007 0.007 ↑ 1.0 1 1

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

52.          

SubPlan (for Hash Left Join)

53. 1.044 93.600 ↓ 0.0 0 936

Nested Loop (cost=1.12..61.26 rows=1 width=0) (actual time=0.100..0.100 rows=0 loops=936)

54. 2.368 88.920 ↑ 16.0 1 936

Nested Loop (cost=0.70..48.77 rows=16 width=4) (actual time=0.088..0.095 rows=1 loops=936)

55. 4.680 4.680 ↑ 1.0 1 936

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht (cost=0.28..8.30 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=936)

  • 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)))
56. 81.872 81.872 ↑ 17.0 1 731

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd (cost=0.42..40.30 rows=17 width=8) (actual time=0.104..0.112 rows=1 loops=731)

  • 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: 58
57. 3.636 3.636 ↓ 0.0 0 909

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi (cost=0.42..0.77 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=909)

  • Index Cond: (horarioturmadia = htd.codigo)
  • Filter: ((disciplina = 5,730) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
  • Rows Removed by Filter: 1
58. 0.936 5.616 ↓ 0.0 0 936

Nested Loop (cost=1.43..40.17 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=936)

59. 0.936 4.680 ↓ 0.0 0 936

Nested Loop (cost=1.01..27.68 rows=16 width=4) (actual time=0.005..0.005 rows=0 loops=936)

60. 0.936 3.744 ↓ 0.0 0 936

Nested Loop (cost=0.57..23.71 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=936)

61. 2.808 2.808 ↓ 0.0 0 936

Index Scan using idx_turma_turmaprincipal on turma t_2 (cost=0.29..15.39 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=936)

  • Index Cond: (turmaprincipal = turma.codigo)
  • Filter: (subturma AND (NOT turmaagrupada) AND ((situacao)::text = 'AB'::text))
62. 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_2.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)))
63. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_1 (cost=0.44..3.81 rows=17 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)))
64. 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 = 5,730) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
65. 1.872 6.552 ↓ 0.0 0 936

Nested Loop (cost=1.71..33.41 rows=1 width=0) (actual time=0.007..0.007 rows=0 loops=936)

66. 0.000 4.680 ↓ 0.0 0 936

Nested Loop (cost=1.29..20.92 rows=16 width=4) (actual time=0.005..0.005 rows=0 loops=936)

67. 0.936 4.680 ↓ 0.0 0 936

Nested Loop (cost=0.85..16.94 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=936)

68. 0.936 3.744 ↓ 0.0 0 936

Nested Loop (cost=0.57..16.61 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=936)

69. 2.808 2.808 ↓ 0.0 0 936

Index Scan using idx_turmaagrupada_turma on turmaagrupada (cost=0.28..8.30 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=936)

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

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

  • Index Cond: (codigo = turmaagrupada.turmaorigem)
  • Filter: ((situacao)::text = 'AB'::text)
71. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turma = t_3.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)))
72. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_2 (cost=0.44..3.81 rows=17 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)))
73. 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 = 5,730) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
74. 0.936 4.680 ↓ 0.0 0 936

Hash Join (cost=4.35..36.05 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=936)

  • Hash Cond: (htdi_3.disciplina = de.equivalente)
75. 0.936 3.744 ↓ 0.0 0 936

Nested Loop (cost=1.71..33.25 rows=24 width=4) (actual time=0.004..0.004 rows=0 loops=936)

76. 0.000 2.808 ↓ 0.0 0 936

Nested Loop (cost=1.29..20.92 rows=16 width=4) (actual time=0.003..0.003 rows=0 loops=936)

77. 0.936 2.808 ↓ 0.0 0 936

Nested Loop (cost=0.85..16.94 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=936)

78. 0.936 1.872 ↓ 0.0 0 936

Nested Loop (cost=0.57..16.61 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=936)

79. 0.936 0.936 ↓ 0.0 0 936

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_1 (cost=0.28..8.30 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=936)

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

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

  • Index Cond: (codigo = turmaagrupada_1.turmaorigem)
  • Filter: ((situacao)::text = 'AB'::text)
81. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turma = t_4.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)))
82. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_3 (cost=0.44..3.81 rows=17 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)))
83. 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)
84. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.58..2.58 rows=5 width=4) (never executed)

85. 0.000 0.000 ↓ 0.0 0

Seq Scan on disciplinaequivalente de (cost=0.00..2.58 rows=5 width=4) (never executed)

  • Filter: ((disciplina = 5,730) OR (gradedisciplinacomposta.disciplina = disciplina) OR (gdcgd.disciplina = disciplina) OR (gdcgo.disciplina = disciplina))
86. 0.936 5.616 ↓ 0.0 0 936

Nested Loop (cost=2.13..29.65 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=936)

87. 0.936 4.680 ↓ 0.0 0 936

Nested Loop (cost=1.99..29.30 rows=2 width=4) (actual time=0.005..0.005 rows=0 loops=936)

88. 0.936 3.744 ↓ 0.0 0 936

Nested Loop (cost=1.57..28.53 rows=1 width=4) (actual time=0.004..0.004 rows=0 loops=936)

89. 0.000 2.808 ↓ 0.0 0 936

Nested Loop (cost=1.13..24.55 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=936)

90. 0.936 2.808 ↓ 0.0 0 936

Nested Loop (cost=0.85..24.22 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=936)

91. 0.936 1.872 ↓ 0.0 0 936

Nested Loop (cost=0.57..23.71 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=936)

92. 0.936 0.936 ↓ 0.0 0 936

Index Scan using idx_turma_turmaprincipal on turma tsub (cost=0.29..15.40 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=936)

  • Index Cond: (turmaprincipal = turma.codigo)
  • Filter: (subturma AND ((tiposubturma)::text = ANY ('{PRATICA,TEORICA}'::text[])) AND ((situacao)::text = 'AB'::text))
93. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_turmaagrupada_turma on turmaagrupada turmaagrupada_2 (cost=0.28..8.30 rows=1 width=8) (never executed)

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

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

  • Index Cond: (codigo = turmaagrupada_2.turmaorigem)
  • Filter: ((situacao)::text = 'AB'::text)
95. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turma = t_5.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)))
96. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_horarioturmadia_horarioturma_data on horarioturmadia htd_4 (cost=0.44..3.81 rows=17 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)))
97. 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)
98. 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 = 5,730) AND (equivalente = htdi_4.disciplina))
  • Heap Fetches: 0
99. 795.600 457,550.496 ↓ 0.0 0 936

Merge Join (cost=1.69..90,746.31 rows=489 width=0) (actual time=488.836..488.836 rows=0 loops=936)

  • Merge Cond: (t_6.codigo = ht_5.turma)
  • Join Filter: (SubPlan 22)
100. 2.808 13.104 ↑ 3,566.0 1 936

Nested Loop (cost=0.57..2,682.41 rows=3,566 width=12) (actual time=0.014..0.014 rows=1 loops=936)

101. 5.616 5.616 ↑ 4,807.0 1 936

Index Scan using idx_turmaagrupada_turmaorigem on turmaagrupada turmaagrupada_3 (cost=0.28..232.27 rows=4,807 width=8) (actual time=0.006..0.006 rows=1 loops=936)

102. 4.680 4.680 ↑ 1.0 1 936

Index Scan using turma_pkey on turma t_6 (cost=0.29..0.51 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=936)

  • Index Cond: (codigo = turmaagrupada_3.turmaorigem)
  • Filter: ((situacao)::text = 'AB'::text)
103. 1,183.104 456,741.792 ↓ 1.3 3,728 936

Materialize (cost=1.12..80,506.33 rows=2,793 width=12) (actual time=6.744..487.972 rows=3,728 loops=936)

104. 90,499.032 455,558.688 ↓ 1.3 3,728 936

Nested Loop (cost=1.12..80,499.35 rows=2,793 width=12) (actual time=6.739..486.708 rows=3,728 loops=936)

105. 26,579.592 75,208.536 ↓ 1.3 154,835 936

Nested Loop (cost=0.70..12,012.68 rows=120,479 width=16) (actual time=0.013..80.351 rows=154,835 loops=936)

106. 2,184.624 2,184.624 ↓ 1.3 3,308 936

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_5 (cost=0.28..197.65 rows=2,574 width=8) (actual time=0.006..2.334 rows=3,308 loops=936)

  • 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)))
107. 46,444.320 46,444.320 ↑ 1.1 47 3,096,288

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd_5 (cost=0.42..4.07 rows=52 width=16) (actual time=0.003..0.015 rows=47 loops=3,096,288)

  • Index Cond: (horarioturma = ht_5.codigo)
108. 289,851.120 289,851.120 ↓ 0.0 0 144,925,560

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_5 (cost=0.42..0.56 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=144,925,560)

  • Index Cond: (horarioturmadia = htd_5.codigo)
  • Filter: (disciplina = 5,730)
  • Rows Removed by Filter: 1
109.          

SubPlan (for Merge Join)

110. 0.000 0.000 ↓ 0.0 0

Result (cost=0.29..15.40 rows=1 width=4) (never executed)

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

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

  • Index Cond: (turmaprincipal = turma.codigo)
  • Filter: (subturma AND ((tiposubturma)::text = ANY ('{PRATICA,TEORICA}'::text[])) AND ((situacao)::text = 'AB'::text))
112. 2.808 67.392 ↓ 0.0 0 936

Nested Loop (cost=0.70..75.26 rows=1 width=0) (actual time=0.072..0.072 rows=0 loops=936)

113. 64.584 64.584 ↓ 0.0 0 936

Index Scan using unique_programacaotutoriaonline on programacaotutoriaonline (cost=0.28..66.81 rows=1 width=8) (actual time=0.069..0.069 rows=0 loops=936)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5,730))
  • 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)))
  • Rows Removed by Filter: 1
114. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5,730))
  • Filter: (((modalidadedisciplina)::text = 'ON_LINE'::text) AND ((definicoestutoriaonline)::text = 'DINAMICA'::text))
115. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_vagaturma_turma on vagaturma (cost=0.28..0.34 rows=1 width=10) (never executed)

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

Hash (cost=685.61..685.61 rows=2,627 width=12) (never executed)

117. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on vagaturmadisciplina (cost=52.78..685.61 rows=2,627 width=12) (never executed)

  • Recheck Cond: (disciplina = 5,730)
118. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on ch_vagaturmadisciplina_disciplina (cost=0.00..52.12 rows=2,627 width=0) (never executed)

  • Index Cond: (disciplina = 5,730)
119.          

SubPlan (for Hash Left Join)

120. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=159.69..159.70 rows=1 width=8) (never executed)

121. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.40..159.69 rows=1 width=4) (never executed)

  • Join Filter: (((m_1.gradecurricularatual = h_1.matrizcurricular) AND ((h_1.historicocursandoporcorrespondenciaapostransferencia IS NULL) OR (NOT h_1.historicocursandoporcorrespondenciaapostransferencia)) AND ((h_1.transferenciamatrizcurricularmatricula IS NULL) OR ((h_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (NOT (SubPlan 11))))) OR ((m_1.gradecurricularatual <> h_1.matrizcurricular) AND h_1.historicocursandoporcorrespondenciaapostransferencia AND (h_1.transferenciamatrizcurricularmatricula IS NOT NULL) AND (h_1.disciplina = (SubPlan 12))) OR ((h_1.matrizcurricular = mp_2.gradecurricular) AND (m_1.gradecurricularatual <> h_1.matrizcurricular) AND h_1.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 13))))
122. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..94.68 rows=1 width=16) (never executed)

  • Join Filter: (conf_1.codigo = confg_1.configuracoes)
123. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..93.66 rows=1 width=24) (never executed)

  • Join Filter: (ue_1.configuracoes = conf_1.codigo)
124. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..92.64 rows=1 width=20) (never executed)

125. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.83..92.48 rows=1 width=20) (never executed)

126. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.54..88.16 rows=1 width=24) (never executed)

  • Join Filter: CASE WHEN ((c_1.periodicidade)::text = ANY ('{SE,IN}'::text[])) THEN (((mp_2.ano)::text = ''::text) AND ((mp_2.semestre)::text = ''::text)) WHEN ((c_1.periodicidade)::text = 'AN'::text) THEN ((mp_2.ano)::text = ''::text) ELSE ((c_1.periodicidade)::text = 'IN'::text) END
127. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.27..87.85 rows=1 width=30) (never executed)

128. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..87.19 rows=1 width=32) (never executed)

129. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd_1 (cost=0.43..78.75 rows=1 width=12) (never executed)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5,730))
  • Filter: reposicao
130. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo mp_2 (cost=0.42..8.44 rows=1 width=24) (never executed)

  • Index Cond: (codigo = mptd_1.matriculaperiodo)
  • Filter: ((situacaomatriculaperiodo)::text = ANY ('{AT,PR,CO}'::text[]))
131. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (codigo = m_1.curso)
133. 0.000 0.000 ↓ 0.0 0

Index Only Scan using turma_pkey on turma t_1 (cost=0.29..4.30 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turma.codigo)
  • Heap Fetches: 0
134. 0.000 0.000 ↓ 0.0 0

Index Scan using unidadeensino_pkey on unidadeensino ue_1 (cost=0.14..0.16 rows=1 width=8) (never executed)

  • Index Cond: (codigo = m_1.unidadeensino)
135. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuracoes conf_1 (cost=0.00..1.01 rows=1 width=4) (never executed)

136. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuracaogeralsistema confg_1 (cost=0.00..1.01 rows=1 width=4) (never executed)

137. 0.000 0.000 ↓ 0.0 0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico h_1 (cost=0.43..8.45 rows=1 width=38) (never executed)

  • Index Cond: (matriculaperiodoturmadisciplina = mptd_1.codigo)
138.          

SubPlan (for Nested Loop)

139. 0.000 0.000 ↓ 0.0 0

Limit (cost=24.03..28.05 rows=1 width=4) (never executed)

140. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_3 (cost=24.03..28.05 rows=1 width=4) (never executed)

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

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

142. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (h_1.matricula)::text)
143. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (disciplina = h_1.disciplina)
144. 0.000 0.000 ↓ 0.0 0

Limit (cost=24.03..28.05 rows=1 width=4) (never executed)

145. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_4 (cost=24.03..28.05 rows=1 width=4) (never executed)

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

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

147. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = (h_1.matricula)::text)
148. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (disciplina = h_1.disciplina)
149. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((disciplina = h_1.disciplina) AND (matriculaperiodo = h_1.matriculaperiodo) AND (matrizcurricular = m_1.gradecurricularatual))
  • Heap Fetches: 0
150. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=132.02..132.03 rows=1 width=8) (never executed)

151. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=33.56..132.02 rows=1 width=4) (never executed)

  • Join Filter: requerimento_1.disciplinaporequivalencia
  • Filter: ((requerimento_1.disciplina = 5,730) OR (mapaequivalenciadisciplinacursada_1.disciplina = 5,730))
152. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=33.28..123.70 rows=1 width=13) (never executed)

  • Filter: (((requerimento_1.situacaofinanceira)::text = 'IS'::text) OR (contareceber_1.codigo IS NULL) OR (contareceber_1.datavencimento <= CURRENT_DATE))
153. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.85..115.24 rows=1 width=20) (never executed)

  • Join Filter: (((turmareposicao_1.semestral AND ((matper_1.ano)::text = ''::text) AND ((matper_1.semestre)::text = ''::text)) OR (turmareposicao_1.anual AND ((matper_1.ano)::text = ''::text)) OR ((NOT turmareposicao_1.anual) AND (NOT turmareposicao_1.semestral))) AND CASE WHEN (requerimento_1.matriculaperiodo IS NOT NULL) THEN (requerimento_1.matriculaperiodo = matper_1.codigo) ELSE CASE WHEN (requerimento_1.codigo <> 0) THEN (matper_1.turma = requerimento_1.turma) ELSE (matper_1.codigo = (SubPlan 15)) END END)
154. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.43..106.13 rows=1 width=58) (never executed)

155. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.01..97.69 rows=1 width=44) (never executed)

156. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=31.73..89.38 rows=1 width=46) (never executed)

157. 0.000 0.000 ↓ 0.0 0

Seq Scan on tiporequerimento tiporequerimento_1 (cost=0.00..17.88 rows=2 width=4) (never executed)

  • Filter: ((tipo)::text = 'RE'::text)
158. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on requerimento requerimento_1 (cost=31.73..35.74 rows=1 width=50) (never executed)

  • Recheck Cond: ((turmareposicao = turma.codigo) AND (tiporequerimento = tiporequerimento_1.codigo))
  • Filter: ((situacao)::text <> ALL ('{FD,FI}'::text[]))
159. 0.000 0.000 ↓ 0.0 0

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

160. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_requerimento_turmareposicao (cost=0.00..4.60 rows=24 width=0) (never executed)

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

Bitmap Index Scan on ch_requerimento_tiporequerimento (cost=0.00..26.88 rows=1,394 width=0) (never executed)

  • Index Cond: (tiporequerimento = tiporequerimento_1.codigo)
162. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

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

SubPlan (for Nested Loop)

166. 0.000 0.000 ↓ 0.0 0

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

167. 0.000 0.000 ↓ 0.0 0

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

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

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

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

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

  • Index Cond: (codigo = requerimento_1.contareceber)
170. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = requerimento_1.mapaequivalenciadisciplinacursada)
171.          

SubPlan (for GroupAggregate)

172. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=159.69..159.70 rows=1 width=8) (never executed)

173. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=2.40..159.69 rows=1 width=4) (never executed)

  • 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 1))))) OR ((m.gradecurricularatual <> h.matrizcurricular) AND h.historicocursandoporcorrespondenciaapostransferencia AND (h.transferenciamatrizcurricularmatricula IS NOT NULL) AND (h.disciplina = (SubPlan 2))) OR ((h.matrizcurricular = mp.gradecurricular) AND (m.gradecurricularatual <> h.matrizcurricular) AND h.historicodisciplinafazpartecomposicao AND (NOT (SubPlan 3))))
174. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..94.68 rows=1 width=16) (never executed)

  • Join Filter: (conf.codigo = confg.configuracoes)
175. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..93.66 rows=1 width=24) (never executed)

  • Join Filter: (ue.configuracoes = conf.codigo)
176. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.97..92.64 rows=1 width=20) (never executed)

177. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.83..92.48 rows=1 width=20) (never executed)

178. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.54..88.16 rows=1 width=24) (never executed)

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

Nested Loop (cost=1.27..87.85 rows=1 width=30) (never executed)

180. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..87.19 rows=1 width=32) (never executed)

181. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina mptd (cost=0.43..78.75 rows=1 width=12) (never executed)

  • Index Cond: ((turma = turma.codigo) AND (disciplina = 5,730))
  • Filter: reposicao
182. 0.000 0.000 ↓ 0.0 0

Index Scan using matriculaperiodo_pkey on matriculaperiodo mp (cost=0.42..8.44 rows=1 width=24) (never executed)

  • Index Cond: (codigo = mptd.matriculaperiodo)
  • Filter: ((situacaomatriculaperiodo)::text = ANY ('{AT,PR,CO}'::text[]))
183. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (codigo = m.curso)
185. 0.000 0.000 ↓ 0.0 0

Index Only Scan using turma_pkey on turma t (cost=0.29..4.30 rows=1 width=4) (never executed)

  • Index Cond: (codigo = turma.codigo)
  • Heap Fetches: 0
186. 0.000 0.000 ↓ 0.0 0

Index Scan using unidadeensino_pkey on unidadeensino ue (cost=0.14..0.16 rows=1 width=8) (never executed)

  • Index Cond: (codigo = m.unidadeensino)
187. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuracoes conf (cost=0.00..1.01 rows=1 width=4) (never executed)

188. 0.000 0.000 ↓ 0.0 0

Seq Scan on configuracaogeralsistema confg (cost=0.00..1.01 rows=1 width=4) (never executed)

189. 0.000 0.000 ↓ 0.0 0

Index Scan using index_historico_matriculaperiodoturmadisciplina on historico h (cost=0.43..8.45 rows=1 width=38) (never executed)

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

SubPlan (for Nested Loop)

191. 0.000 0.000 ↓ 0.0 0

Limit (cost=24.03..28.05 rows=1 width=4) (never executed)

192. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his (cost=24.03..28.05 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))
193. 0.000 0.000 ↓ 0.0 0

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

194. 0.000 0.000 ↓ 0.0 0

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

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

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

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

Limit (cost=24.03..28.05 rows=1 width=4) (never executed)

197. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on historico his_1 (cost=24.03..28.05 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))
198. 0.000 0.000 ↓ 0.0 0

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

199. 0.000 0.000 ↓ 0.0 0

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

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

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

  • Index Cond: (disciplina = h.disciplina)
201. 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..4.45 rows=1 width=4) (never executed)

  • Index Cond: ((disciplina = h.disciplina) AND (matriculaperiodo = h.matriculaperiodo) AND (matrizcurricular = m.gradecurricularatual))
  • Heap Fetches: 0
202. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=132.02..132.03 rows=1 width=8) (never executed)

203. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=33.56..132.02 rows=1 width=4) (never executed)

  • Join Filter: requerimento.disciplinaporequivalencia
  • Filter: ((requerimento.disciplina = 5,730) OR (mapaequivalenciadisciplinacursada.disciplina = 5,730))
204. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=33.28..123.70 rows=1 width=13) (never executed)

  • Filter: (((requerimento.situacaofinanceira)::text = 'IS'::text) OR (contareceber.codigo IS NULL) OR (contareceber.datavencimento <= CURRENT_DATE))
205. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.85..115.24 rows=1 width=20) (never executed)

  • 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 5)) END END)
206. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.43..106.13 rows=1 width=58) (never executed)

207. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=32.01..97.69 rows=1 width=44) (never executed)

208. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=31.73..89.38 rows=1 width=46) (never executed)

209. 0.000 0.000 ↓ 0.0 0

Seq Scan on tiporequerimento (cost=0.00..17.88 rows=2 width=4) (never executed)

  • Filter: ((tipo)::text = 'RE'::text)
210. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on requerimento (cost=31.73..35.74 rows=1 width=50) (never executed)

  • Recheck Cond: ((turmareposicao = turma.codigo) AND (tiporequerimento = tiporequerimento.codigo))
  • Filter: ((situacao)::text <> ALL ('{FD,FI}'::text[]))
211. 0.000 0.000 ↓ 0.0 0

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

212. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_requerimento_turmareposicao (cost=0.00..4.60 rows=24 width=0) (never executed)

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

Bitmap Index Scan on ch_requerimento_tiporequerimento (cost=0.00..26.88 rows=1,394 width=0) (never executed)

  • Index Cond: (tiporequerimento = tiporequerimento.codigo)
214. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = turma.codigo)
215. 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)
216. 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[]))
217.          

SubPlan (for Nested Loop)

218. 0.000 0.000 ↓ 0.0 0

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

219. 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
220. 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)
221. 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)
222. 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)
Planning time : 176.584 ms
Execution time : 458,135.995 ms