explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vmDO

Settings
# exclusive inclusive rows x rows loops node
1. 33.668 7,837.435 ↑ 7.0 4,669 1

Sort (cost=106,209,465.30..106,209,546.95 rows=32,661 width=2,424) (actual time=7,837.118..7,837.435 rows=4,669 loops=1)

  • Sort Key: "*SELECT* 1".datainicio, "*SELECT* 1".nomeunidadeensino, "*SELECT* 1".identificadorturma, "*SELECT* 1".nomedisciplina
  • Sort Method: quicksort Memory: 2830kB
2. 43.021 7,803.767 ↑ 7.0 4,669 1

Nested Loop Left Join (cost=18,050.76..106,207,016.49 rows=32,661 width=2,424) (actual time=177.352..7,803.767 rows=4,669 loops=1)

  • Join Filter: ((gradedisciplina.codigo IS NULL) AND (gradecurriculargrupooptativadisciplina.codigo IS NULL))
3. 31.497 5,412.239 ↑ 7.0 4,669 1

Nested Loop Left Join (cost=17,527.32..51,168,240.16 rows=32,661 width=2,368) (actual time=176.759..5,412.239 rows=4,669 loops=1)

4. 44.112 5,306.038 ↑ 4.7 4,669 1

Nested Loop Left Join (cost=17,436.63..45,407,756.84 rows=21,777 width=2,360) (actual time=176.713..5,306.038 rows=4,669 loops=1)

  • Join Filter: (turmadisciplina.gradedisciplina IS NULL)
5. 7.672 5,196.560 ↑ 4.7 4,669 1

Nested Loop Left Join (cost=17,351.43..39,766,751.58 rows=21,777 width=2,356) (actual time=176.654..5,196.560 rows=4,669 loops=1)

6. 1.375 5,165.543 ↑ 4.7 4,669 1

Append (cost=17,351.14..39,754,822.73 rows=21,777 width=2,348) (actual time=176.641..5,165.543 rows=4,669 loops=1)

7. 2.486 5,007.698 ↑ 4.8 4,508 1

Subquery Scan on *SELECT* 1 (cost=17,351.14..39,608,997.19 rows=21,633 width=323) (actual time=176.640..5,007.698 rows=4,508 loops=1)

8. 63.944 5,005.212 ↑ 4.8 4,508 1

HashAggregate (cost=17,351.14..39,608,780.86 rows=21,633 width=335) (actual time=176.638..5,005.212 rows=4,508 loops=1)

  • Group Key: cidade.codigo, unidadeensino.codigo, turma.codigo, disciplina.codigo, pessoa.codigo, horarioturmadiaitem.disciplina, curso.nome, horarioturma.codigo, turno.codigo, periodoletivo.periodoletivo
9. 44.976 144.756 ↑ 1.2 18,136 1

Gather (cost=3,848.46..16,648.07 rows=21,633 width=275) (actual time=23.458..144.756 rows=18,136 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
10. 2.836 99.780 ↑ 1.5 6,045 3 / 3

Hash Left Join (cost=2,848.46..13,484.77 rows=9,014 width=275) (actual time=23.206..99.780 rows=6,045 loops=3)

  • Hash Cond: (turma.curso = curso.codigo)
11. 2.874 90.671 ↑ 1.5 6,045 3 / 3

Hash Left Join (cost=2,819.43..13,431.85 rows=9,014 width=228) (actual time=16.918..90.671 rows=6,045 loops=3)

  • Hash Cond: (turma.periodoletivo = periodoletivo.codigo)
12. 3.065 87.221 ↑ 1.5 6,045 3 / 3

Hash Join (cost=2,789.39..13,378.03 rows=9,014 width=228) (actual time=16.330..87.221 rows=6,045 loops=3)

  • Hash Cond: (turma.turno = turno.codigo)
13. 4.296 83.793 ↑ 1.5 6,045 3 / 3

Nested Loop (cost=2,787.85..13,348.64 rows=9,014 width=213) (actual time=15.832..83.793 rows=6,045 loops=3)

14. 3.081 61.361 ↑ 1.5 6,045 3 / 3

Hash Join (cost=2,787.43..7,252.23 rows=9,014 width=161) (actual time=15.798..61.361 rows=6,045 loops=3)

  • Hash Cond: (horarioturmadiaitem.disciplina = disciplina.codigo)
15. 2.734 55.404 ↑ 1.5 6,045 3 / 3

Hash Join (cost=2,595.47..7,036.59 rows=9,014 width=112) (actual time=12.881..55.404 rows=6,045 loops=3)

  • Hash Cond: (unidadeensino.cidade = cidade.codigo)
16. 2.462 48.653 ↑ 1.5 6,045 3 / 3

Hash Join (cost=2,252.38..6,669.83 rows=9,014 width=93) (actual time=8.806..48.653 rows=6,045 loops=3)

  • Hash Cond: (turma.unidadeensino = unidadeensino.codigo)
17. 3.770 45.809 ↑ 1.5 6,045 3 / 3

Hash Join (cost=2,244.65..6,637.13 rows=9,014 width=73) (actual time=8.404..45.809 rows=6,045 loops=3)

  • Hash Cond: (horarioturma.turma = turma.codigo)
18. 2.774 37.850 ↑ 1.2 8,177 3 / 3

Hash Join (cost=2,046.85..6,413.65 rows=9,777 width=26) (actual time=4.145..37.850 rows=8,177 loops=3)

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
19. 23.705 33.596 ↑ 1.2 8,177 3 / 3

Parallel Hash Join (cost=1,951.10..6,292.20 rows=9,777 width=20) (actual time=2.622..33.596 rows=8,177 loops=3)

  • Hash Cond: (horarioturmadiaitem.horarioturmadia = horarioturmadia.codigo)
20. 7.456 7.456 ↑ 1.2 77,249 3 / 3

Parallel Seq Scan on horarioturmadiaitem (cost=0.00..4,087.61 rows=96,561 width=16) (actual time=0.011..7.456 rows=77,249 loops=3)

21. 0.999 2.435 ↑ 1.8 5,047 3 / 3

Parallel Hash (cost=1,837.67..1,837.67 rows=9,075 width=16) (actual time=2.435..2.435 rows=5,047 loops=3)

  • Buckets: 16384 Batches: 1 Memory Usage: 864kB
22. 1.092 1.436 ↓ 1.7 15,140 1 / 3

Parallel Bitmap Heap Scan on horarioturmadia (cost=330.55..1,837.67 rows=9,075 width=16) (actual time=1.105..4.308 rows=15,140 loops=1)

  • Recheck Cond: ((data >= '2020-03-06 00:00:00'::timestamp without time zone) AND (data <= '2020-12-31 23:59:59.059'::timestamp without time zone))
  • Heap Blocks: exact=548
23. 0.344 0.344 ↑ 1.0 15,140 1 / 3

Bitmap Index Scan on idx_horarioturmadia_data (cost=0.00..326.69 rows=15,427 width=0) (actual time=1.033..1.033 rows=15,140 loops=1)

  • Index Cond: ((data >= '2020-03-06 00:00:00'::timestamp without time zone) AND (data <= '2020-12-31 23:59:59.059'::timestamp without time zone))
24. 0.599 1.480 ↑ 1.0 3,100 3 / 3

Hash (cost=57.00..57.00 rows=3,100 width=10) (actual time=1.480..1.480 rows=3,100 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 166kB
25. 0.881 0.881 ↑ 1.0 3,100 3 / 3

Seq Scan on horarioturma (cost=0.00..57.00 rows=3,100 width=10) (actual time=0.305..0.881 rows=3,100 loops=3)

26. 1.430 4.189 ↑ 1.0 4,403 3 / 3

Hash (cost=142.76..142.76 rows=4,403 width=47) (actual time=4.189..4.189 rows=4,403 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 437kB
27. 2.759 2.759 ↑ 1.0 4,403 3 / 3

Seq Scan on turma (cost=0.00..142.76 rows=4,403 width=47) (actual time=0.230..2.759 rows=4,403 loops=3)

  • Filter: ((NOT anual) AND (NOT semestral))
  • Rows Removed by Filter: 373
28. 0.022 0.382 ↑ 1.0 77 3 / 3

Hash (cost=6.77..6.77 rows=77 width=24) (actual time=0.382..0.382 rows=77 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
29. 0.360 0.360 ↑ 1.0 77 3 / 3

Seq Scan on unidadeensino (cost=0.00..6.77 rows=77 width=24) (actual time=0.317..0.360 rows=77 loops=3)

30. 1.952 4.017 ↑ 1.0 10,626 3 / 3

Hash (cost=210.26..210.26 rows=10,626 width=23) (actual time=4.017..4.017 rows=10,626 loops=3)

  • Buckets: 16384 Batches: 1 Memory Usage: 706kB
31. 2.065 2.065 ↑ 1.0 10,626 3 / 3

Seq Scan on cidade (cost=0.00..210.26 rows=10,626 width=23) (actual time=0.492..2.065 rows=10,626 loops=3)

32. 1.160 2.876 ↑ 1.0 5,465 3 / 3

Hash (cost=123.65..123.65 rows=5,465 width=49) (actual time=2.876..2.876 rows=5,465 loops=3)

  • Buckets: 8192 Batches: 1 Memory Usage: 500kB
33. 1.716 1.716 ↑ 1.0 5,465 3 / 3

Seq Scan on disciplina (cost=0.00..123.65 rows=5,465 width=49) (actual time=0.396..1.716 rows=5,465 loops=3)

34. 18.136 18.136 ↑ 1.0 1 18,136 / 3

Index Scan using pessoa_pkey on pessoa (cost=0.42..0.68 rows=1 width=56) (actual time=0.003..0.003 rows=1 loops=18,136)

  • Index Cond: (codigo = horarioturmadiaitem.professor)
35. 0.018 0.363 ↑ 1.0 24 3 / 3

Hash (cost=1.24..1.24 rows=24 width=19) (actual time=0.363..0.363 rows=24 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
36. 0.345 0.345 ↑ 1.0 24 3 / 3

Seq Scan on turno (cost=0.00..1.24 rows=24 width=19) (actual time=0.339..0.345 rows=24 loops=3)

37. 0.137 0.576 ↑ 1.0 846 3 / 3

Hash (cost=19.46..19.46 rows=846 width=8) (actual time=0.576..0.576 rows=846 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 42kB
38. 0.439 0.439 ↑ 1.0 846 3 / 3

Seq Scan on periodoletivo (cost=0.00..19.46 rows=846 width=8) (actual time=0.303..0.439 rows=846 loops=3)

39. 0.112 6.273 ↑ 1.0 446 3 / 3

Hash (cost=23.46..23.46 rows=446 width=51) (actual time=6.273..6.273 rows=446 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 46kB
40. 6.161 6.161 ↑ 1.0 446 3 / 3

Seq Scan on curso (cost=0.00..23.46 rows=446 width=51) (actual time=5.999..6.161 rows=446 loops=3)

41.          

SubPlan (for HashAggregate)

42. 4.508 982.744 ↑ 1.0 1 4,508

Aggregate (cost=288.68..288.69 rows=1 width=8) (actual time=0.218..0.218 rows=1 loops=4,508)

43. 9.016 978.236 ↑ 27.5 2 4,508

Unique (cost=287.72..288.00 rows=55 width=4) (actual time=0.216..0.217 rows=2 loops=4,508)

44. 9.016 969.220 ↑ 27.5 2 4,508

Sort (cost=287.72..287.86 rows=55 width=4) (actual time=0.215..0.215 rows=2 loops=4,508)

  • Sort Key: arquivo.codigo
  • Sort Method: quicksort Memory: 25kB
45. 108.192 960.204 ↑ 27.5 2 4,508

Append (cost=10.15..286.13 rows=55 width=4) (actual time=0.173..0.213 rows=2 loops=4,508)

46. 135.240 256.956 ↑ 1.0 1 4,508

Bitmap Heap Scan on arquivo (cost=10.15..14.17 rows=1 width=4) (actual time=0.055..0.057 rows=1 loops=4,508)

  • Recheck Cond: ((disciplina = horarioturmadiaitem.disciplina) AND (professor = pessoa.codigo))
  • Filter: (turma IS NULL)
  • Rows Removed by Filter: 31
  • Heap Blocks: exact=112773
47. 23.082 121.716 ↓ 0.0 0 4,508

BitmapAnd (cost=10.15..10.15 rows=1 width=0) (actual time=0.027..0.027 rows=0 loops=4,508)

48. 58.604 58.604 ↓ 1.6 102 4,508

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.013..0.013 rows=102 loops=4,508)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
49. 40.030 40.030 ↓ 1.2 93 4,003

Bitmap Index Scan on ch_arquivo_professor (cost=0.00..5.01 rows=78 width=0) (actual time=0.010..0.010 rows=93 loops=4,003)

  • Index Cond: (professor = pessoa.codigo)
50. 4.508 94.668 ↓ 0.0 0 4,508

Bitmap Heap Scan on arquivo arquivo_1 (cost=10.00..14.02 rows=1 width=4) (actual time=0.021..0.021 rows=0 loops=4,508)

  • Recheck Cond: ((turma = horarioturma.turma) AND (disciplina = horarioturmadiaitem.disciplina))
  • Filter: (professor IS NULL)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=662
51. 10.306 90.160 ↓ 0.0 0 4,508

BitmapAnd (cost=10.00..10.00 rows=1 width=0) (actual time=0.020..0.020 rows=0 loops=4,508)

52. 36.064 36.064 ↑ 1.1 51 4,508

Bitmap Index Scan on ch_arquivo_turma (cost=0.00..4.86 rows=58 width=0) (actual time=0.008..0.008 rows=51 loops=4,508)

  • Index Cond: (turma = horarioturma.turma)
53. 43.790 43.790 ↓ 1.7 104 4,379

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.010..0.010 rows=104 loops=4,379)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
54. 4.508 81.144 ↓ 0.0 0 4,508

Bitmap Heap Scan on arquivo arquivo_2 (cost=10.00..14.02 rows=1 width=4) (actual time=0.018..0.018 rows=0 loops=4,508)

  • Recheck Cond: ((turma = horarioturma.turma) AND (disciplina = horarioturmadiaitem.disciplina))
  • Filter: (professor = pessoa.codigo)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=662
55. 10.177 76.636 ↓ 0.0 0 4,508

BitmapAnd (cost=10.00..10.00 rows=1 width=0) (actual time=0.017..0.017 rows=0 loops=4,508)

56. 27.048 27.048 ↑ 1.1 51 4,508

Bitmap Index Scan on ch_arquivo_turma (cost=0.00..4.86 rows=58 width=0) (actual time=0.006..0.006 rows=51 loops=4,508)

  • Index Cond: (turma = horarioturma.turma)
57. 39.411 39.411 ↓ 1.7 104 4,379

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.009..0.009 rows=104 loops=4,379)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
58. 378.672 419.244 ↑ 52.0 1 4,508

Bitmap Heap Scan on arquivo arquivo_3 (cost=4.90..243.11 rows=52 width=4) (actual time=0.078..0.093 rows=1 loops=4,508)

  • Recheck Cond: (disciplina = horarioturmadiaitem.disciplina)
  • Filter: ((professor IS NULL) AND (turma IS NULL))
  • Rows Removed by Filter: 101
  • Heap Blocks: exact=375398
59. 40.572 40.572 ↓ 1.6 102 4,508

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.009..0.009 rows=102 loops=4,508)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
60. 4.508 906.108 ↑ 1.0 1 4,508

Aggregate (cost=322.67..322.68 rows=1 width=8) (actual time=0.201..0.201 rows=1 loops=4,508)

61. 8.310 901.600 ↑ 1.0 1 4,508

Nested Loop (cost=0.57..322.67 rows=1 width=4) (actual time=0.165..0.200 rows=1 loops=4,508)

62. 117.208 117.208 ↓ 4.8 86 4,508

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina (cost=0.29..23.97 rows=18 width=8) (actual time=0.005..0.026 rows=86 loops=4,508)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
63. 776.082 776.082 ↓ 0.0 0 388,041

Index Scan using vagaturma_pkey on vagaturma (cost=0.28..16.58 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=388,041)

  • Index Cond: (codigo = vagaturmadisciplina.vagaturma)
  • Filter: (((ano)::text = (horarioturma.anovigente)::text) AND ((semestre)::text = (horarioturma.semestrevigente)::text) AND (((NOT turma.turmaagrupada) AND (turma = turma.codigo)) OR (turma.turmaagrupada AND (SubPlan 8))))
  • Rows Removed by Filter: 1
64.          

SubPlan (for Index Scan)

65. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_3 (cost=8.71..12.72 rows=1 width=4) (never executed)

  • Recheck Cond: ((turmaorigem = turma.codigo) AND (turma = vagaturma.turma))
66. 0.000 0.000 ↓ 0.0 0

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

67. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turmaorigem = turma.codigo)
68. 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 = vagaturma.turma)
69. 4.508 838.488 ↑ 1.0 1 4,508

Aggregate (cost=322.67..322.68 rows=1 width=8) (actual time=0.186..0.186 rows=1 loops=4,508)

70. 0.000 833.980 ↑ 1.0 1 4,508

Nested Loop (cost=0.57..322.67 rows=1 width=4) (actual time=0.153..0.185 rows=1 loops=4,508)

71. 85.652 85.652 ↓ 4.8 86 4,508

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_1 (cost=0.29..23.97 rows=18 width=8) (actual time=0.003..0.019 rows=86 loops=4,508)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
72. 776.082 776.082 ↓ 0.0 0 388,041

Index Scan using vagaturma_pkey on vagaturma vagaturma_1 (cost=0.28..16.58 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=388,041)

  • Index Cond: (codigo = vagaturmadisciplina_1.vagaturma)
  • Filter: (((ano)::text = (horarioturma.anovigente)::text) AND ((semestre)::text = (horarioturma.semestrevigente)::text) AND (((NOT turma.turmaagrupada) AND (turma = turma.codigo)) OR (turma.turmaagrupada AND (SubPlan 10))))
  • Rows Removed by Filter: 1
73.          

SubPlan (for Index Scan)

74. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_4 (cost=8.71..12.72 rows=1 width=4) (never executed)

  • Recheck Cond: ((turmaorigem = turma.codigo) AND (turma = vagaturma_1.turma))
75. 0.000 0.000 ↓ 0.0 0

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

76. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turmaorigem = turma.codigo)
77. 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 = vagaturma_1.turma)
78. 63.112 1,104.460 ↑ 1.0 1 4,508

Aggregate (cost=254.25..254.26 rows=1 width=8) (actual time=0.245..0.245 rows=1 loops=4,508)

79. 136.887 1,041.348 ↓ 1.8 48 4,508

Nested Loop (cost=1.40..254.18 rows=27 width=4) (actual time=0.017..0.231 rows=48 loops=4,508)

80. 160.626 676.200 ↓ 1.9 51 4,508

Nested Loop (cost=1.12..246.01 rows=27 width=4) (actual time=0.013..0.150 rows=51 loops=4,508)

81. 22.540 175.812 ↓ 2.1 38 4,508

Nested Loop (cost=0.70..45.01 rows=18 width=4) (actual time=0.009..0.039 rows=38 loops=4,508)

82. 13.524 13.524 ↑ 1.0 1 4,508

Index Only Scan using horarioturma_pkey on horarioturma ht (cost=0.28..4.30 rows=1 width=4) (actual time=0.002..0.003 rows=1 loops=4,508)

  • Index Cond: (codigo = horarioturma.codigo)
  • Heap Fetches: 0
83. 139.748 139.748 ↓ 2.1 38 4,508

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd (cost=0.42..40.53 rows=18 width=8) (actual time=0.005..0.031 rows=38 loops=4,508)

  • Index Cond: (horarioturma = horarioturma.codigo)
  • Filter: (data < max(horarioturmadia.data))
  • Rows Removed by Filter: 17
84. 339.762 339.762 ↑ 2.0 1 169,881

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi (cost=0.42..11.15 rows=2 width=8) (actual time=0.002..0.002 rows=1 loops=169,881)

  • Index Cond: (horarioturmadia = htd.codigo)
85. 228.261 228.261 ↑ 1.0 1 228,261

Index Only Scan using disciplina_pkey on disciplina dis (cost=0.28..0.30 rows=1 width=4) (actual time=0.001..0.001 rows=1 loops=228,261)

  • Index Cond: (codigo = htdi.disciplina)
  • Filter: (codigo <> disciplina.codigo)
  • Rows Removed by Filter: 0
  • Heap Fetches: 0
86. 9.016 964.712 ↑ 1.0 1 4,508

Subquery Scan on ordem (cost=639.35..641.81 rows=1 width=8) (actual time=0.210..0.214 rows=1 loops=4,508)

  • Filter: (ordem.disciplina = horarioturmadiaitem.disciplina)
  • Rows Removed by Filter: 17
87. 49.588 955.696 ↑ 4.6 18 4,508

WindowAgg (cost=639.35..640.78 rows=82 width=20) (actual time=0.203..0.212 rows=18 loops=4,508)

88. 27.048 906.108 ↑ 4.6 18 4,508

Sort (cost=639.35..639.55 rows=82 width=12) (actual time=0.200..0.201 rows=18 loops=4,508)

  • Sort Key: (min(htd_1.data))
  • Sort Method: quicksort Memory: 25kB
89. 81.144 879.060 ↑ 4.6 18 4,508

GroupAggregate (cost=635.31..636.74 rows=82 width=12) (actual time=0.177..0.195 rows=18 loops=4,508)

  • Group Key: htdi_1.disciplina
90. 81.144 797.916 ↑ 1.1 73 4,508

Sort (cost=635.31..635.51 rows=82 width=12) (actual time=0.174..0.177 rows=73 loops=4,508)

  • Sort Key: htdi_1.disciplina
  • Sort Method: quicksort Memory: 28kB
91. 143.730 716.772 ↑ 1.1 73 4,508

Nested Loop (cost=0.84..632.70 rows=82 width=12) (actual time=0.008..0.159 rows=73 loops=4,508)

92. 76.636 76.636 ↓ 1.0 55 4,508

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd_1 (cost=0.42..40.40 rows=54 width=12) (actual time=0.004..0.017 rows=55 loops=4,508)

  • Index Cond: (horarioturma = horarioturma.codigo)
93. 496.406 496.406 ↑ 2.0 1 248,203

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_1 (cost=0.42..10.95 rows=2 width=8) (actual time=0.002..0.002 rows=1 loops=248,203)

  • Index Cond: (horarioturmadia = htd_1.codigo)
  • Filter: (disciplina IS NOT NULL)
94. 0.094 156.470 ↓ 1.1 161 1

Subquery Scan on *SELECT* 2 (cost=1,853.77..145,716.66 rows=144 width=328) (actual time=11.239..156.470 rows=161 loops=1)

95. 1.182 156.376 ↓ 1.1 161 1

Group (cost=1,853.77..145,714.50 rows=144 width=328) (actual time=11.237..156.376 rows=161 loops=1)

  • Group Key: cidade_1.codigo, unidadeensino_1.codigo, turma_1.codigo, disciplina_1.codigo, pessoa_1.codigo, curso_1.nome, programacaotutoriaonline.codigo, turno_1.codigo, periodoletivo_1.periodoletivo
96. 0.361 10.455 ↓ 1.1 161 1

Sort (cost=1,853.77..1,854.13 rows=144 width=280) (actual time=10.407..10.455 rows=161 loops=1)

  • Sort Key: cidade_1.codigo, unidadeensino_1.codigo, turma_1.codigo, disciplina_1.codigo, pessoa_1.codigo, curso_1.nome, programacaotutoriaonline.codigo, turno_1.codigo, periodoletivo_1.periodoletivo
  • Sort Method: quicksort Memory: 103kB
97. 0.075 10.094 ↓ 1.1 161 1

Nested Loop Left Join (cost=461.80..1,848.61 rows=144 width=280) (actual time=6.796..10.094 rows=161 loops=1)

98. 0.179 9.697 ↓ 1.1 161 1

Nested Loop Left Join (cost=461.53..1,803.84 rows=144 width=233) (actual time=6.777..9.697 rows=161 loops=1)

99. 0.090 9.357 ↓ 1.1 161 1

Hash Join (cost=461.25..1,759.63 rows=144 width=233) (actual time=6.761..9.357 rows=161 loops=1)

  • Hash Cond: (turma_1.turno = turno_1.codigo)
100. 0.192 9.246 ↓ 1.1 161 1

Nested Loop (cost=459.71..1,757.64 rows=144 width=218) (actual time=6.730..9.246 rows=161 loops=1)

101. 0.095 8.571 ↓ 1.1 161 1

Hash Join (cost=459.29..738.41 rows=144 width=166) (actual time=6.631..8.571 rows=161 loops=1)

  • Hash Cond: (programacaotutoriaonline.disciplina = disciplina_1.codigo)
102. 0.496 6.276 ↓ 1.1 161 1

Merge Join (cost=267.33..546.07 rows=144 width=117) (actual time=4.424..6.276 rows=161 loops=1)

  • Merge Cond: (cidade_1.codigo = unidadeensino_1.cidade)
103. 1.356 1.356 ↑ 1.9 5,614 1

Index Scan using cidade_pkey on cidade cidade_1 (cost=0.29..495.84 rows=10,626 width=23) (actual time=0.013..1.356 rows=5,614 loops=1)

104. 0.127 4.424 ↓ 1.1 161 1

Sort (cost=267.04..267.40 rows=144 width=98) (actual time=4.406..4.424 rows=161 loops=1)

  • Sort Key: unidadeensino_1.cidade
  • Sort Method: quicksort Memory: 59kB
105. 0.056 4.297 ↓ 1.1 161 1

Hash Join (cost=237.97..261.88 rows=144 width=98) (actual time=3.981..4.297 rows=161 loops=1)

  • Hash Cond: (turma_1.unidadeensino = unidadeensino_1.codigo)
106. 0.140 4.179 ↓ 1.1 161 1

Hash Join (cost=230.24..253.75 rows=144 width=78) (actual time=3.913..4.179 rows=161 loops=1)

  • Hash Cond: (programacaotutoriaonline.turma = turma_1.codigo)
107. 0.172 0.502 ↓ 1.0 161 1

Hash Join (cost=32.44..55.54 rows=155 width=31) (actual time=0.297..0.502 rows=161 loops=1)

  • Hash Cond: (programacaotutoriaonlineprofessor.programacaotutoriaonline = programacaotutoriaonline.codigo)
108. 0.078 0.078 ↑ 1.0 1,116 1

Seq Scan on programacaotutoriaonlineprofessor (cost=0.00..20.16 rows=1,116 width=8) (actual time=0.010..0.078 rows=1,116 loops=1)

109. 0.036 0.252 ↑ 1.0 143 1

Hash (cost=30.63..30.63 rows=145 width=27) (actual time=0.252..0.252 rows=143 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
110. 0.216 0.216 ↑ 1.0 143 1

Seq Scan on programacaotutoriaonline (cost=0.00..30.63 rows=145 width=27) (actual time=0.009..0.216 rows=143 loops=1)

  • Filter: ((datainicioaula >= '2020-03-06'::date) AND (datainicioaula <= '2020-12-31'::date))
  • Rows Removed by Filter: 899
111. 1.338 3.537 ↑ 1.0 4,403 1

Hash (cost=142.76..142.76 rows=4,403 width=47) (actual time=3.537..3.537 rows=4,403 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 437kB
112. 2.199 2.199 ↑ 1.0 4,403 1

Seq Scan on turma turma_1 (cost=0.00..142.76 rows=4,403 width=47) (actual time=0.011..2.199 rows=4,403 loops=1)

  • Filter: ((NOT anual) AND (NOT semestral))
  • Rows Removed by Filter: 373
113. 0.021 0.062 ↑ 1.0 77 1

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

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

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

115. 1.069 2.200 ↑ 1.0 5,465 1

Hash (cost=123.65..123.65 rows=5,465 width=49) (actual time=2.200..2.200 rows=5,465 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 500kB
116. 1.131 1.131 ↑ 1.0 5,465 1

Seq Scan on disciplina disciplina_1 (cost=0.00..123.65 rows=5,465 width=49) (actual time=0.008..1.131 rows=5,465 loops=1)

117. 0.483 0.483 ↑ 1.0 1 161

Index Scan using pessoa_pkey on pessoa pessoa_1 (cost=0.42..7.08 rows=1 width=56) (actual time=0.003..0.003 rows=1 loops=161)

  • Index Cond: (codigo = programacaotutoriaonlineprofessor.professor)
118. 0.006 0.021 ↑ 1.0 24 1

Hash (cost=1.24..1.24 rows=24 width=19) (actual time=0.021..0.021 rows=24 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
119. 0.015 0.015 ↑ 1.0 24 1

Seq Scan on turno turno_1 (cost=0.00..1.24 rows=24 width=19) (actual time=0.011..0.015 rows=24 loops=1)

120. 0.161 0.161 ↑ 1.0 1 161

Index Scan using periodoletivo_pkey on periodoletivo periodoletivo_1 (cost=0.28..0.31 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=161)

  • Index Cond: (codigo = turma_1.periodoletivo)
121. 0.322 0.322 ↑ 1.0 1 161

Index Scan using curso_pkey on curso curso_1 (cost=0.27..0.31 rows=1 width=51) (actual time=0.002..0.002 rows=1 loops=161)

  • Index Cond: (codigo = turma_1.curso)
122.          

SubPlan (for Group)

123. 0.161 8.050 ↑ 1.0 1 161

Aggregate (cost=288.68..288.69 rows=1 width=8) (actual time=0.049..0.050 rows=1 loops=161)

124. 0.161 7.889 ↓ 0.0 0 161

Unique (cost=287.72..288.00 rows=55 width=4) (actual time=0.049..0.049 rows=0 loops=161)

125. 0.322 7.728 ↓ 0.0 0 161

Sort (cost=287.72..287.86 rows=55 width=4) (actual time=0.048..0.048 rows=0 loops=161)

  • Sort Key: arquivo_4.codigo
  • Sort Method: quicksort Memory: 25kB
126. 3.220 7.406 ↓ 0.0 0 161

Append (cost=10.15..286.13 rows=55 width=4) (actual time=0.046..0.046 rows=0 loops=161)

127. 0.161 1.127 ↓ 0.0 0 161

Bitmap Heap Scan on arquivo arquivo_4 (cost=10.15..14.17 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=161)

  • Recheck Cond: ((disciplina = programacaotutoriaonline.disciplina) AND (professor = pessoa_1.codigo))
  • Filter: (turma IS NULL)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=6
128. 0.130 0.966 ↓ 0.0 0 161

BitmapAnd (cost=10.15..10.15 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=161)

129. 0.644 0.644 ↑ 20.7 3 161

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.004..0.004 rows=3 loops=161)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
130. 0.192 0.192 ↑ 1.9 42 32

Bitmap Index Scan on ch_arquivo_professor (cost=0.00..5.01 rows=78 width=0) (actual time=0.006..0.006 rows=42 loops=32)

  • Index Cond: (professor = pessoa_1.codigo)
131. 0.161 1.127 ↓ 0.0 0 161

Bitmap Heap Scan on arquivo arquivo_5 (cost=10.00..14.02 rows=1 width=4) (actual time=0.007..0.007 rows=0 loops=161)

  • Recheck Cond: ((turma = programacaotutoriaonline.turma) AND (disciplina = programacaotutoriaonline.disciplina))
  • Filter: (professor IS NULL)
132. 0.098 0.966 ↓ 0.0 0 161

BitmapAnd (cost=10.00..10.00 rows=1 width=0) (actual time=0.006..0.006 rows=0 loops=161)

133. 0.644 0.644 ↑ 5.3 11 161

Bitmap Index Scan on ch_arquivo_turma (cost=0.00..4.86 rows=58 width=0) (actual time=0.004..0.004 rows=11 loops=161)

  • Index Cond: (turma = programacaotutoriaonline.turma)
134. 0.224 0.224 ↑ 62.0 1 112

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.002..0.002 rows=1 loops=112)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
135. 0.161 0.966 ↓ 0.0 0 161

Bitmap Heap Scan on arquivo arquivo_6 (cost=10.00..14.02 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=161)

  • Recheck Cond: ((turma = programacaotutoriaonline.turma) AND (disciplina = programacaotutoriaonline.disciplina))
  • Filter: (professor = pessoa_1.codigo)
136. 0.098 0.805 ↓ 0.0 0 161

BitmapAnd (cost=10.00..10.00 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=161)

137. 0.483 0.483 ↑ 5.3 11 161

Bitmap Index Scan on ch_arquivo_turma (cost=0.00..4.86 rows=58 width=0) (actual time=0.003..0.003 rows=11 loops=161)

  • Index Cond: (turma = programacaotutoriaonline.turma)
138. 0.224 0.224 ↑ 62.0 1 112

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.002..0.002 rows=1 loops=112)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
139. 0.644 0.966 ↓ 0.0 0 161

Bitmap Heap Scan on arquivo arquivo_7 (cost=4.90..243.11 rows=52 width=4) (actual time=0.006..0.006 rows=0 loops=161)

  • Recheck Cond: (disciplina = programacaotutoriaonline.disciplina)
  • Filter: ((professor IS NULL) AND (turma IS NULL))
  • Rows Removed by Filter: 3
  • Heap Blocks: exact=362
140. 0.322 0.322 ↑ 20.7 3 161

Bitmap Index Scan on ch_arquivo_disciplina (cost=0.00..4.89 rows=62 width=0) (actual time=0.002..0.002 rows=3 loops=161)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
141. 0.161 50.876 ↑ 1.0 1 161

Aggregate (cost=322.67..322.68 rows=1 width=8) (actual time=0.316..0.316 rows=1 loops=161)

142. 18.283 50.715 ↓ 0.0 0 161

Nested Loop (cost=0.57..322.67 rows=1 width=4) (actual time=0.315..0.315 rows=0 loops=161)

143. 5.474 5.474 ↓ 9.3 167 161

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_2 (cost=0.29..23.97 rows=18 width=8) (actual time=0.003..0.034 rows=167 loops=161)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
144. 26.958 26.958 ↓ 0.0 0 26,958

Index Scan using vagaturma_pkey on vagaturma vagaturma_2 (cost=0.28..16.58 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=26,958)

  • Index Cond: (codigo = vagaturmadisciplina_2.vagaturma)
  • Filter: (((ano)::text = (programacaotutoriaonline.ano)::text) AND ((semestre)::text = (programacaotutoriaonline.semestre)::text) AND (((NOT turma_1.turmaagrupada) AND (turma = turma_1.codigo)) OR (turma_1.turmaagrupada AND (SubPlan 15))))
  • Rows Removed by Filter: 1
145.          

SubPlan (for Index Scan)

146. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_5 (cost=8.71..12.72 rows=1 width=4) (never executed)

  • Recheck Cond: ((turmaorigem = turma_1.codigo) AND (turma = vagaturma_2.turma))
147. 0.000 0.000 ↓ 0.0 0

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

148. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turmaorigem = turma_1.codigo)
149. 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 = vagaturma_2.turma)
150. 0.161 49.749 ↑ 1.0 1 161

Aggregate (cost=322.67..322.68 rows=1 width=8) (actual time=0.309..0.309 rows=1 loops=161)

151. 17.961 49.588 ↓ 0.0 0 161

Nested Loop (cost=0.57..322.67 rows=1 width=4) (actual time=0.308..0.308 rows=0 loops=161)

152. 4.669 4.669 ↓ 9.3 167 161

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_3 (cost=0.29..23.97 rows=18 width=8) (actual time=0.002..0.029 rows=167 loops=161)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
153. 26.958 26.958 ↓ 0.0 0 26,958

Index Scan using vagaturma_pkey on vagaturma vagaturma_3 (cost=0.28..16.58 rows=1 width=4) (actual time=0.001..0.001 rows=0 loops=26,958)

  • Index Cond: (codigo = vagaturmadisciplina_3.vagaturma)
  • Filter: (((ano)::text = (programacaotutoriaonline.ano)::text) AND ((semestre)::text = (programacaotutoriaonline.semestre)::text) AND (((NOT turma_1.turmaagrupada) AND (turma = turma_1.codigo)) OR (turma_1.turmaagrupada AND (SubPlan 17))))
  • Rows Removed by Filter: 1
154.          

SubPlan (for Index Scan)

155. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on turmaagrupada turmaagrupada_6 (cost=8.71..12.72 rows=1 width=4) (never executed)

  • Recheck Cond: ((turmaorigem = turma_1.codigo) AND (turma = vagaturma_3.turma))
156. 0.000 0.000 ↓ 0.0 0

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

157. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (turmaorigem = turma_1.codigo)
158. 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 = vagaturma_3.turma)
159. 0.483 0.966 ↑ 1.0 1 161

Aggregate (cost=12.60..12.61 rows=1 width=8) (actual time=0.006..0.006 rows=1 loops=161)

160. 0.000 0.483 ↓ 0.0 0 161

Nested Loop (cost=0.56..12.60 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=161)

161. 0.483 0.483 ↓ 0.0 0 161

Index Scan using programacaotutoriaonline_pkey on programacaotutoriaonline pto (cost=0.28..8.30 rows=1 width=4) (actual time=0.003..0.003 rows=0 loops=161)

  • Index Cond: (codigo = programacaotutoriaonline.codigo)
  • Filter: (dataterminoaula < programacaotutoriaonline.dataterminoaula)
  • Rows Removed by Filter: 1
162. 0.000 0.000 ↓ 0.0 0

Index Only Scan using disciplina_pkey on disciplina dis_1 (cost=0.28..4.30 rows=1 width=4) (never executed)

  • Index Cond: (codigo = pto.disciplina)
  • Filter: (codigo <> disciplina_1.codigo)
  • Heap Fetches: 0
163. 2.576 35.098 ↑ 1.0 1 161

Subquery Scan on ordem_1 (cost=44.23..52.33 rows=1 width=8) (actual time=0.162..0.218 rows=1 loops=161)

  • Filter: (ordem_1.disciplina = programacaotutoriaonline.disciplina)
  • Rows Removed by Filter: 269
164. 17.549 32.522 ↑ 1.0 270 161

WindowAgg (cost=44.23..48.96 rows=270 width=16) (actual time=0.083..0.202 rows=270 loops=161)

165. 8.694 14.973 ↑ 1.0 270 161

Sort (cost=44.23..44.91 rows=270 width=8) (actual time=0.080..0.093 rows=270 loops=161)

  • Sort Key: (min(pto_1.datainicioaula))
  • Sort Method: quicksort Memory: 37kB
166. 6.130 6.279 ↑ 1.0 270 161

HashAggregate (cost=30.63..33.33 rows=270 width=8) (actual time=0.003..0.039 rows=270 loops=161)

  • Group Key: pto_1.disciplina
167. 0.149 0.149 ↑ 1.0 1,042 1

Seq Scan on programacaotutoriaonline pto_1 (cost=0.00..25.42 rows=1,042 width=8) (actual time=0.009..0.149 rows=1,042 loops=1)

  • Filter: (disciplina IS NOT NULL)
168. 23.345 23.345 ↑ 1.0 1 4,669

Index Scan using idx_turmadisciplina_turma_disciplina on turmadisciplina (cost=0.29..0.53 rows=1 width=16) (actual time=0.004..0.005 rows=1 loops=4,669)

  • Index Cond: ((turma = "*SELECT* 1".turma) AND (disciplina = "*SELECT* 1".disciplina))
169. 0.000 65.366 ↓ 0.0 0 4,669

Bitmap Heap Scan on gradecurriculargrupooptativadisciplina (cost=85.20..259.03 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=4,669)

  • Recheck Cond: ((codigo = (SubPlan 4)) OR (turmadisciplina.gradecurriculargrupooptativadisciplina = codigo))
  • Filter: (("*SELECT* 1".turmaagrupada AND (codigo = (SubPlan 4))) OR (turmadisciplina.gradecurriculargrupooptativadisciplina = codigo))
170. 65.366 65.366 ↓ 0.0 0 4,669

BitmapOr (cost=85.20..85.20 rows=2 width=0) (actual time=0.014..0.014 rows=0 loops=4,669)

171. 0.000 0.000 ↓ 0.0 0 4,669

Bitmap Index Scan on gradecurriculargrupooptativadisciplina_pkey (cost=0.00..85.04 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Index Cond: (codigo = (SubPlan 4))
172.          

SubPlan (for Bitmap Index Scan)

173. 9.338 56.028 ↑ 1.0 1 4,669

Aggregate (cost=84.89..84.90 rows=1 width=4) (actual time=0.012..0.012 rows=1 loops=4,669)

174. 13.997 46.690 ↓ 0.0 0 4,669

Hash Join (cost=15.20..84.89 rows=1 width=4) (actual time=0.010..0.010 rows=0 loops=4,669)

  • Hash Cond: (td_1.turma = turmaagrupada_1.turma)
175. 0.010 0.010 ↑ 20.0 1 1

Index Scan using ch_turmadisciplina_disciplina on turmadisciplina td_1 (cost=0.29..69.89 rows=20 width=8) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (disciplina = "*SELECT* 1".disciplina)
176. 18.676 32.683 ↓ 0.0 0 4,669

Hash (cost=14.79..14.79 rows=10 width=4) (actual time=0.007..0.007 rows=0 loops=4,669)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
177. 4.669 14.007 ↓ 0.0 0 4,669

Bitmap Heap Scan on turmaagrupada turmaagrupada_1 (cost=4.23..14.79 rows=10 width=4) (actual time=0.003..0.003 rows=0 loops=4,669)

  • Recheck Cond: (turmaorigem = "*SELECT* 1".turma)
178. 9.338 9.338 ↓ 0.0 0 4,669

Bitmap Index Scan on idx_turmaagrupada_turmaorigem (cost=0.00..4.23 rows=10 width=0) (actual time=0.002..0.002 rows=0 loops=4,669)

  • Index Cond: (turmaorigem = "*SELECT* 1".turma)
179. 0.000 0.000 ↓ 0.0 0 4,669

Bitmap Index Scan on gradecurriculargrupooptativadisciplina_pkey (cost=0.00..0.15 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Index Cond: (codigo = turmadisciplina.gradecurriculargrupooptativadisciplina)
180. 9.338 74.704 ↑ 1.0 1 4,669

Bitmap Heap Scan on gradedisciplina (cost=90.69..264.51 rows=1 width=12) (actual time=0.016..0.016 rows=1 loops=4,669)

  • Recheck Cond: ((codigo = (SubPlan 3)) OR (turmadisciplina.gradedisciplina = codigo))
  • Filter: (("*SELECT* 1".turmaagrupada AND (codigo = (SubPlan 3))) OR (turmadisciplina.gradedisciplina = codigo))
  • Heap Blocks: exact=4656
181. 51.359 65.366 ↓ 0.0 0 4,669

BitmapOr (cost=90.69..90.69 rows=2 width=0) (actual time=0.014..0.014 rows=0 loops=4,669)

182. 0.000 0.000 ↓ 0.0 0 4,669

Bitmap Index Scan on gradedisciplina_pkey (cost=0.00..85.20 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Index Cond: (codigo = (SubPlan 3))
183.          

SubPlan (for Bitmap Index Scan)

184. 4.669 42.021 ↑ 1.0 1 4,669

Aggregate (cost=84.89..84.90 rows=1 width=4) (actual time=0.009..0.009 rows=1 loops=4,669)

185. 9.331 37.352 ↓ 0.0 0 4,669

Hash Join (cost=15.20..84.89 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=4,669)

  • Hash Cond: (td.turma = turmaagrupada.turma)
186. 0.007 0.007 ↑ 20.0 1 1

Index Scan using ch_turmadisciplina_disciplina on turmadisciplina td (cost=0.29..69.89 rows=20 width=8) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (disciplina = "*SELECT* 1".disciplina)
187. 18.676 28.014 ↓ 0.0 0 4,669

Hash (cost=14.79..14.79 rows=10 width=4) (actual time=0.006..0.006 rows=0 loops=4,669)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
188. 4.669 9.338 ↓ 0.0 0 4,669

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

  • Recheck Cond: (turmaorigem = "*SELECT* 1".turma)
189. 4.669 4.669 ↓ 0.0 0 4,669

Bitmap Index Scan on idx_turmaagrupada_turmaorigem (cost=0.00..4.23 rows=10 width=0) (actual time=0.001..0.001 rows=0 loops=4,669)

  • Index Cond: (turmaorigem = "*SELECT* 1".turma)
190. 14.007 14.007 ↑ 1.0 1 4,669

Bitmap Index Scan on gradedisciplina_pkey (cost=0.00..0.29 rows=1 width=0) (actual time=0.003..0.003 rows=1 loops=4,669)

  • Index Cond: (codigo = turmadisciplina.gradedisciplina)
191. 4.669 149.408 ↓ 0.0 0 4,669

Bitmap Heap Scan on gradedisciplinacomposta (cost=523.44..1,573.73 rows=1 width=12) (actual time=0.032..0.032 rows=0 loops=4,669)

  • Recheck Cond: ((codigo = (SubPlan 5)) OR (codigo = (SubPlan 6)))
  • Filter: (("*SELECT* 1".turmaagrupada AND (codigo = (SubPlan 5))) OR (codigo = (SubPlan 6)))
192. 144.739 144.739 ↓ 0.0 0 4,669

BitmapOr (cost=523.44..523.44 rows=2 width=0) (actual time=0.031..0.031 rows=0 loops=4,669)

193. 0.000 0.000 ↓ 0.0 0 4,669

Bitmap Index Scan on gradedisciplinacomposta_pkey (cost=0.00..463.05 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Index Cond: (codigo = (SubPlan 5))
194.          

SubPlan (for Bitmap Index Scan)

195. 4.669 32.683 ↑ 1.0 1 4,669

Aggregate (cost=462.88..462.89 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=4,669)

196. 0.000 28.014 ↓ 0.0 0 4,669

Nested Loop (cost=4.52..462.88 rows=1 width=4) (actual time=0.006..0.006 rows=0 loops=4,669)

  • Join Filter: ((gdc.gradecurriculargrupooptativadisciplina = td_2.gradecurriculargrupooptativadisciplina) OR (gdc.gradedisciplina = td_2.gradedisciplina))
197. 18.676 28.014 ↓ 0.0 0 4,669

Nested Loop (cost=4.52..442.78 rows=174 width=8) (actual time=0.006..0.006 rows=0 loops=4,669)

198. 4.669 9.338 ↓ 0.0 0 4,669

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

  • Recheck Cond: (turmaorigem = "*SELECT* 1".turma)
199. 4.669 4.669 ↓ 0.0 0 4,669

Bitmap Index Scan on idx_turmaagrupada_turmaorigem (cost=0.00..4.23 rows=10 width=0) (actual time=0.001..0.001 rows=0 loops=4,669)

  • Index Cond: (turmaorigem = "*SELECT* 1".turma)
200. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_turmadisciplina_turma on turmadisciplina td_2 (cost=0.29..42.63 rows=17 width=12) (never executed)

  • Index Cond: (turma = turmaagrupada_2.turma)
201. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..14.01 rows=2 width=12) (never executed)

202. 0.000 0.000 ↓ 0.0 0

Seq Scan on gradedisciplinacomposta gdc (cost=0.00..14.00 rows=2 width=12) (never executed)

  • Filter: (disciplina = "*SELECT* 1".disciplina)
203. 0.000 0.000 ↓ 0.0 0 4,669

Bitmap Index Scan on gradedisciplinacomposta_pkey (cost=0.00..60.40 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Index Cond: (codigo = (SubPlan 6))
204.          

SubPlan (for Bitmap Index Scan)

205. 46.690 98.049 ↓ 0.0 0 4,669

Nested Loop (cost=0.29..60.24 rows=1 width=4) (actual time=0.021..0.021 rows=0 loops=4,669)

  • Join Filter: ((gdc_1.gradecurriculargrupooptativadisciplina = td_3.gradecurriculargrupooptativadisciplina) OR (gdc_1.gradedisciplina = td_3.gradedisciplina))
206. 51.359 51.359 ↓ 1.1 19 4,669

Index Scan using ch_turmadisciplina_turma on turmadisciplina td_3 (cost=0.29..45.64 rows=17 width=8) (actual time=0.004..0.011 rows=19 loops=4,669)

  • Index Cond: (turma = "*SELECT* 1".turma)
207. 0.000 0.000 ↓ 0.0 0 87,575

Materialize (cost=0.00..14.01 rows=2 width=12) (actual time=0.000..0.000 rows=0 loops=87,575)

208. 0.000 0.000 ↓ 0.0 0 4,669

Seq Scan on gradedisciplinacomposta gdc_1 (cost=0.00..14.00 rows=2 width=12) (actual time=0.000..0.000 rows=0 loops=4,669)

  • Filter: (disciplina = "*SELECT* 1".disciplina)
209.          

SubPlan (for Nested Loop Left Join)

210. 37.352 1,106.553 ↑ 1.0 1 4,669

Aggregate (cost=55.69..55.70 rows=1 width=32) (actual time=0.237..0.237 rows=1 loops=4,669)

211. 12.225 1,069.201 ↑ 1.0 1 4,669

Nested Loop (cost=0.70..55.69 rows=1 width=25) (actual time=0.134..0.229 rows=1 loops=4,669)

212. 26.232 1,041.187 ↑ 1.0 1 4,669

Nested Loop (cost=0.28..50.39 rows=1 width=4) (actual time=0.130..0.223 rows=1 loops=4,669)

213. 999.166 999.166 ↑ 1.0 1 4,669

Seq Scan on cursocoordenador c (cost=0.00..42.09 rows=1 width=4) (actual time=0.122..0.214 rows=1 loops=4,669)

  • Filter: (((curso = "*SELECT* 1".curso) AND (unidadeensino = "*SELECT* 1".unidadeensino) AND (turma IS NULL)) OR (turma = "*SELECT* 1".turma))
  • Rows Removed by Filter: 1490
214. 15.789 15.789 ↑ 1.0 1 5,263

Index Scan using funcionario_pkey on funcionario (cost=0.28..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=5,263)

  • Index Cond: (codigo = c.funcionario)
215. 15.789 15.789 ↑ 1.0 1 5,263

Index Scan using pessoa_pkey on pessoa pessoa_2 (cost=0.42..5.29 rows=1 width=29) (actual time=0.003..0.003 rows=1 loops=5,263)

  • Index Cond: (codigo = funcionario.pessoa)
216. 28.014 1,092.546 ↑ 1.0 1 4,669

Aggregate (cost=55.69..55.71 rows=1 width=32) (actual time=0.234..0.234 rows=1 loops=4,669)

217. 2.887 1,064.532 ↑ 1.0 1 4,669

Nested Loop (cost=0.70..55.69 rows=1 width=15) (actual time=0.134..0.228 rows=1 loops=4,669)

218. 35.570 1,045.856 ↑ 1.0 1 4,669

Nested Loop (cost=0.28..50.39 rows=1 width=4) (actual time=0.131..0.224 rows=1 loops=4,669)

219. 994.497 994.497 ↑ 1.0 1 4,669

Seq Scan on cursocoordenador c_1 (cost=0.00..42.09 rows=1 width=4) (actual time=0.121..0.213 rows=1 loops=4,669)

  • Filter: (((curso = "*SELECT* 1".curso) AND (unidadeensino = "*SELECT* 1".unidadeensino) AND (turma IS NULL)) OR (turma = "*SELECT* 1".turma))
  • Rows Removed by Filter: 1490
220. 15.789 15.789 ↑ 1.0 1 5,263

Index Scan using funcionario_pkey on funcionario funcionario_1 (cost=0.28..8.30 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=5,263)

  • Index Cond: (codigo = c_1.funcionario)
221. 15.789 15.789 ↑ 1.0 1 5,263

Index Scan using pessoa_pkey on pessoa pessoa_3 (cost=0.42..5.29 rows=1 width=19) (actual time=0.003..0.003 rows=1 loops=5,263)

  • Index Cond: (codigo = funcionario_1.pessoa)
  • Filter: ((email)::text <> ''::text)
Planning time : 15.752 ms
Execution time : 7,842.476 ms