explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aFP2

Settings
# exclusive inclusive rows x rows loops node
1. 36.555 15,666.891 ↑ 7.0 4,669 1

Sort (cost=98,174,894.05..98,174,975.70 rows=32,661 width=2,424) (actual time=15,666.463..15,666.891 rows=4,669 loops=1)

  • Sort Key: "*SELECT* 1".datainicio, "*SELECT* 1".nomeunidadeensino, "*SELECT* 1".identificadorturma, "*SELECT* 1".nomedisciplina
  • Sort Method: quicksort Memory: 2,830kB
2. 59.521 15,630.336 ↑ 7.0 4,669 1

Nested Loop Left Join (cost=18,050.76..98,172,445.24 rows=32,661 width=2,424) (actual time=197.118..15,630.336 rows=4,669 loops=1)

  • Join Filter: ((gradedisciplina.codigo IS NULL) AND (gradecurriculargrupooptativadisciplina.codigo IS NULL))
3. 37.312 13,026.210 ↑ 7.0 4,669 1

Nested Loop Left Join (cost=17,527.32..43,133,668.91 rows=32,661 width=2,368) (actual time=196.476..13,026.210 rows=4,669 loops=1)

4. 63.747 12,890.849 ↑ 4.7 4,669 1

Nested Loop Left Join (cost=17,436.63..37,373,185.59 rows=21,777 width=2,360) (actual time=196.428..12,890.849 rows=4,669 loops=1)

  • Join Filter: (turmadisciplina.gradedisciplina IS NULL)
5. 11.644 12,738.391 ↑ 4.7 4,669 1

Nested Loop Left Join (cost=17,351.43..31,732,180.33 rows=21,777 width=2,356) (actual time=196.375..12,738.391 rows=4,669 loops=1)

6. 1.984 12,698.733 ↑ 4.7 4,669 1

Append (cost=17,351.14..31,720,251.48 rows=21,777 width=2,348) (actual time=196.362..12,698.733 rows=4,669 loops=1)

7. 3.800 12,514.499 ↑ 4.8 4,508 1

Subquery Scan on *SELECT* 1 (cost=17,351.14..31,627,554.39 rows=21,633 width=323) (actual time=196.361..12,514.499 rows=4,508 loops=1)

8. 85.313 12,510.699 ↑ 4.8 4,508 1

HashAggregate (cost=17,351.14..31,627,338.06 rows=21,633 width=335) (actual time=196.360..12,510.699 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. 73.767 168.134 ↑ 1.2 18,136 1

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

  • Workers Planned: 2
  • Workers Launched: 2
10. 5.217 94.367 ↑ 1.5 6,045 3 / 3

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

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

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

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

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

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

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

14. 3.117 60.333 ↑ 1.5 6,045 3 / 3

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

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

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

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

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

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

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

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

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

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

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

  • Hash Cond: (horarioturmadiaitem.horarioturmadia = horarioturmadia.codigo)
20. 6.387 6.387 ↑ 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.010..6.387 rows=77,249 loops=3)

21. 1.026 2.469 ↑ 1.8 5,047 3 / 3

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 864kB
22. 1.101 1.443 ↓ 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.097..4.328 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.342 0.342 ↑ 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.025..1.025 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.583 1.449 ↑ 1.0 3,100 3 / 3

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

  • Buckets: 4,096 Batches: 1 Memory Usage: 166kB
25. 0.866 0.866 ↑ 1.0 3,100 3 / 3

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

26. 1.479 4.176 ↑ 1.0 4,403 3 / 3

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 437kB
27. 2.697 2.697 ↑ 1.0 4,403 3 / 3

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

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
29. 0.380 0.380 ↑ 1.0 77 3 / 3

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

30. 1.866 3.652 ↑ 1.0 10,626 3 / 3

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

  • Buckets: 16,384 Batches: 1 Memory Usage: 706kB
31. 1.786 1.786 ↑ 1.0 10,626 3 / 3

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

32. 1.123 2.645 ↑ 1.0 5,465 3 / 3

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 500kB
33. 1.522 1.522 ↑ 1.0 5,465 3 / 3

Seq Scan on disciplina (cost=0.00..123.65 rows=5,465 width=49) (actual time=0.244..1.522 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.017 0.369 ↑ 1.0 24 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
36. 0.352 0.352 ↑ 1.0 24 3 / 3

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

37. 0.132 0.514 ↑ 1.0 846 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 42kB
38. 0.382 0.382 ↑ 1.0 846 3 / 3

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

39. 0.098 0.491 ↑ 1.0 446 3 / 3

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 46kB
40. 0.393 0.393 ↑ 1.0 446 3 / 3

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

41.          

SubPlan (for HashAggregate)

42. 9.016 1,113.476 ↑ 1.0 1 4,508

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

43. 9.016 1,104.460 ↑ 27.5 2 4,508

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

44. 13.524 1,095.444 ↑ 27.5 2 4,508

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

  • Sort Key: arquivo.codigo
  • Sort Method: quicksort Memory: 25kB
45. 126.224 1,081.920 ↑ 27.5 2 4,508

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

46. 144.256 288.512 ↑ 1.0 1 4,508

Bitmap Heap Scan on arquivo (cost=10.15..14.17 rows=1 width=4) (actual time=0.063..0.064 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=112,773
47. 28.600 144.256 ↓ 0.0 0 4,508

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

48. 67.620 67.620 ↓ 1.6 102 4,508

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

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

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

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

Bitmap Heap Scan on arquivo arquivo_1 (cost=10.00..14.02 rows=1 width=4) (actual time=0.024..0.024 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. 14.943 103.684 ↓ 0.0 0 4,508

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

52. 40.572 40.572 ↑ 1.1 51 4,508

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

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

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

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

Bitmap Heap Scan on arquivo arquivo_2 (cost=10.00..14.02 rows=1 width=4) (actual time=0.020..0.020 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. 14.814 85.652 ↓ 0.0 0 4,508

BitmapAnd (cost=10.00..10.00 rows=1 width=0) (actual time=0.019..0.019 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. 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)
58. 423.752 468.832 ↑ 52.0 1 4,508

Bitmap Heap Scan on arquivo arquivo_3 (cost=4.90..243.11 rows=52 width=4) (actual time=0.086..0.104 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=375,398
59. 45.080 45.080 ↓ 1.6 102 4,508

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

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

Aggregate (cost=138.20..138.21 rows=1 width=8) (actual time=0.990..0.990 rows=1 loops=4,508)

61. 53.228 4,449.396 ↑ 1.0 1 4,508

Hash Join (cost=39.00..138.20 rows=1 width=4) (actual time=0.915..0.987 rows=1 loops=4,508)

  • Hash Cond: (vagaturma.codigo = vagaturmadisciplina.vagaturma)
62. 4,215.456 4,215.456 ↑ 104.0 1 4,428

Seq Scan on vagaturma (cost=14.81..113.73 rows=104 width=4) (actual time=0.876..0.952 rows=1 loops=4,428)

  • Filter: (((ano)::text = (horarioturma.anovigente)::text) AND ((semestre)::text = (horarioturma.semestrevigente)::text) AND (((NOT turma.turmaagrupada) AND (turma = turma.codigo)) OR (turma.turmaagrupada AND (hashed SubPlan 8))))
  • Rows Removed by Filter: 3,745
63.          

SubPlan (for Seq Scan)

64. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turmaorigem = turma.codigo)
65. 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)
66. 51.632 180.712 ↓ 4.7 85 3,688

Hash (cost=23.97..23.97 rows=18 width=8) (actual time=0.049..0.049 rows=85 loops=3,688)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
67. 129.080 129.080 ↓ 4.7 85 3,688

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina (cost=0.29..23.97 rows=18 width=8) (actual time=0.006..0.035 rows=85 loops=3,688)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
68. 13.524 4,381.776 ↑ 1.0 1 4,508

Aggregate (cost=138.20..138.21 rows=1 width=8) (actual time=0.972..0.972 rows=1 loops=4,508)

69. 53.256 4,368.252 ↑ 1.0 1 4,508

Hash Join (cost=39.00..138.20 rows=1 width=4) (actual time=0.900..0.969 rows=1 loops=4,508)

  • Hash Cond: (vagaturma_1.codigo = vagaturmadisciplina_1.vagaturma)
70. 4,149.036 4,149.036 ↑ 104.0 1 4,428

Seq Scan on vagaturma vagaturma_1 (cost=14.81..113.73 rows=104 width=4) (actual time=0.864..0.937 rows=1 loops=4,428)

  • Filter: (((ano)::text = (horarioturma.anovigente)::text) AND ((semestre)::text = (horarioturma.semestrevigente)::text) AND (((NOT turma.turmaagrupada) AND (turma = turma.codigo)) OR (turma.turmaagrupada AND (hashed SubPlan 10))))
  • Rows Removed by Filter: 3,745
71.          

SubPlan (for Seq Scan)

72. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turmaorigem = turma.codigo)
73. 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)
74. 51.632 165.960 ↓ 4.7 85 3,688

Hash (cost=23.97..23.97 rows=18 width=8) (actual time=0.045..0.045 rows=85 loops=3,688)

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
75. 114.328 114.328 ↓ 4.7 85 3,688

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_1 (cost=0.29..23.97 rows=18 width=8) (actual time=0.006..0.031 rows=85 loops=3,688)

  • Index Cond: (disciplina = horarioturmadiaitem.disciplina)
76. 76.636 1,226.176 ↑ 1.0 1 4,508

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

77. 159.427 1,149.540 ↓ 1.8 48 4,508

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

78. 44.841 761.852 ↓ 1.9 51 4,508

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

79. 31.556 207.368 ↓ 2.1 38 4,508

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

80. 22.540 22.540 ↑ 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.005..0.005 rows=1 loops=4,508)

  • Index Cond: (codigo = horarioturma.codigo)
  • Heap Fetches: 0
81. 153.272 153.272 ↓ 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.007..0.034 rows=38 loops=4,508)

  • Index Cond: (horarioturma = horarioturma.codigo)
  • Filter: (data < max(horarioturmadia.data))
  • Rows Removed by Filter: 17
82. 509.643 509.643 ↑ 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.003 rows=1 loops=169,881)

  • Index Cond: (horarioturmadia = htd.codigo)
83. 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
84. 13.524 1,072.904 ↑ 1.0 1 4,508

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

  • Filter: (ordem.disciplina = horarioturmadiaitem.disciplina)
  • Rows Removed by Filter: 17
85. 58.604 1,059.380 ↑ 4.6 18 4,508

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

86. 31.556 1,000.776 ↑ 4.6 18 4,508

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

  • Sort Key: (min(htd_1.data))
  • Sort Method: quicksort Memory: 25kB
87. 85.652 969.220 ↑ 4.6 18 4,508

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

  • Group Key: htdi_1.disciplina
88. 99.176 883.568 ↑ 1.1 73 4,508

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

  • Sort Key: htdi_1.disciplina
  • Sort Method: quicksort Memory: 28kB
89. 202.334 784.392 ↑ 1.1 73 4,508

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

90. 85.652 85.652 ↓ 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.005..0.019 rows=55 loops=4,508)

  • Index Cond: (horarioturma = horarioturma.codigo)
91. 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)
92. 0.096 182.250 ↓ 1.1 161 1

Subquery Scan on *SELECT* 2 (cost=1,853.77..92,588.21 rows=144 width=328) (actual time=12.700..182.250 rows=161 loops=1)

93. 1.449 182.154 ↓ 1.1 161 1

Group (cost=1,853.77..92,586.05 rows=144 width=328) (actual time=12.698..182.154 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
94. 0.299 11.172 ↓ 1.1 161 1

Sort (cost=1,853.77..1,854.13 rows=144 width=280) (actual time=11.123..11.172 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
95. 0.161 10.873 ↓ 1.1 161 1

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

96. 0.159 10.551 ↓ 1.1 161 1

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

97. 0.095 10.231 ↓ 1.1 161 1

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

  • Hash Cond: (turma_1.turno = turno_1.codigo)
98. 0.071 10.115 ↓ 1.1 161 1

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

99. 0.101 9.561 ↓ 1.1 161 1

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

  • Hash Cond: (programacaotutoriaonline.disciplina = disciplina_1.codigo)
100. 0.508 7.312 ↓ 1.1 161 1

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

  • Merge Cond: (cidade_1.codigo = unidadeensino_1.cidade)
101. 1.672 1.672 ↑ 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.285..1.672 rows=5,614 loops=1)

102. 0.172 5.132 ↓ 1.1 161 1

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

  • Sort Key: unidadeensino_1.cidade
  • Sort Method: quicksort Memory: 59kB
103. 0.077 4.960 ↓ 1.1 161 1

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

  • Hash Cond: (turma_1.unidadeensino = unidadeensino_1.codigo)
104. 0.142 4.813 ↓ 1.1 161 1

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

  • Hash Cond: (programacaotutoriaonline.turma = turma_1.codigo)
105. 0.277 0.649 ↓ 1.0 161 1

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

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

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

107. 0.053 0.277 ↑ 1.0 143 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
108. 0.224 0.224 ↑ 1.0 143 1

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

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

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 437kB
110. 2.410 2.410 ↑ 1.0 4,403 1

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

  • Filter: ((NOT anual) AND (NOT semestral))
  • Rows Removed by Filter: 373
111. 0.030 0.070 ↑ 1.0 77 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 13kB
112. 0.040 0.040 ↑ 1.0 77 1

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

113. 1.049 2.148 ↑ 1.0 5,465 1

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 500kB
114. 1.099 1.099 ↑ 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.099 rows=5,465 loops=1)

115. 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)
116. 0.006 0.021 ↑ 1.0 24 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
117. 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)

118. 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)
119. 0.161 0.161 ↑ 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.001..0.001 rows=1 loops=161)

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

SubPlan (for Group)

121. 0.161 8.372 ↑ 1.0 1 161

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

122. 0.161 8.211 ↓ 0.0 0 161

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

123. 0.322 8.050 ↓ 0.0 0 161

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

  • Sort Key: arquivo_4.codigo
  • Sort Method: quicksort Memory: 25kB
124. 3.542 7.728 ↓ 0.0 0 161

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

125. 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
126. 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)

127. 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)
128. 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)
129. 0.000 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)
130. 0.259 1.127 ↓ 0.0 0 161

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

131. 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)
132. 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)
133. 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)
134. 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)

135. 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)
136. 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)
137. 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
138. 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)
139. 0.000 62.146 ↑ 1.0 1 161

Aggregate (cost=138.20..138.21 rows=1 width=8) (actual time=0.386..0.386 rows=1 loops=161)

140. 0.805 62.146 ↓ 0.0 0 161

Hash Join (cost=39.00..138.20 rows=1 width=4) (actual time=0.386..0.386 rows=0 loops=161)

  • Hash Cond: (vagaturma_2.codigo = vagaturmadisciplina_2.vagaturma)
141. 61.341 61.341 ↓ 0.0 0 161

Seq Scan on vagaturma vagaturma_2 (cost=14.81..113.73 rows=104 width=4) (actual time=0.381..0.381 rows=0 loops=161)

  • 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 (hashed SubPlan 15))))
  • Rows Removed by Filter: 3,746
142.          

SubPlan (for Seq Scan)

143. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turmaorigem = turma_1.codigo)
144. 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)
145. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.97..23.97 rows=18 width=8) (never executed)

146. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_2 (cost=0.29..23.97 rows=18 width=8) (never executed)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
147. 0.161 62.307 ↑ 1.0 1 161

Aggregate (cost=138.20..138.21 rows=1 width=8) (actual time=0.386..0.387 rows=1 loops=161)

148. 0.966 62.146 ↓ 0.0 0 161

Hash Join (cost=39.00..138.20 rows=1 width=4) (actual time=0.386..0.386 rows=0 loops=161)

  • Hash Cond: (vagaturma_3.codigo = vagaturmadisciplina_3.vagaturma)
149. 61.180 61.180 ↓ 0.0 0 161

Seq Scan on vagaturma vagaturma_3 (cost=14.81..113.73 rows=104 width=4) (actual time=0.380..0.380 rows=0 loops=161)

  • 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 (hashed SubPlan 17))))
  • Rows Removed by Filter: 3,746
150.          

SubPlan (for Seq Scan)

151. 0.000 0.000 ↓ 0.0 0

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

  • Recheck Cond: (turmaorigem = turma_1.codigo)
152. 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)
153. 0.000 0.000 ↓ 0.0 0

Hash (cost=23.97..23.97 rows=18 width=8) (never executed)

154. 0.000 0.000 ↓ 0.0 0

Index Scan using ch_vagaturmadisciplina_disciplina on vagaturmadisciplina vagaturmadisciplina_3 (cost=0.29..23.97 rows=18 width=8) (never executed)

  • Index Cond: (disciplina = programacaotutoriaonline.disciplina)
155. 0.644 1.449 ↑ 1.0 1 161

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

156. 0.161 0.805 ↓ 0.0 0 161

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

157. 0.644 0.644 ↓ 0.0 0 161

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

  • Index Cond: (codigo = programacaotutoriaonline.codigo)
  • Filter: (dataterminoaula < programacaotutoriaonline.dataterminoaula)
  • Rows Removed by Filter: 1
158. 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
159. 2.415 35.259 ↑ 1.0 1 161

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

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

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

161. 8.855 15.295 ↑ 1.0 270 161

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

  • Sort Key: (min(pto_1.datainicioaula))
  • Sort Method: quicksort Memory: 37kB
162. 6.294 6.440 ↑ 1.0 270 161

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

  • Group Key: pto_1.disciplina
163. 0.146 0.146 ↑ 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.146 rows=1,042 loops=1)

  • Filter: (disciplina IS NOT NULL)
164. 28.014 28.014 ↑ 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.005..0.006 rows=1 loops=4,669)

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

Bitmap Heap Scan on gradecurriculargrupooptativadisciplina (cost=85.20..259.03 rows=1 width=8) (actual time=0.019..0.019 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))
166. 88.711 88.711 ↓ 0.0 0 4,669

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

167. 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))
168.          

SubPlan (for Bitmap Index Scan)

169. 9.338 70.035 ↑ 1.0 1 4,669

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

170. 13.997 60.697 ↓ 0.0 0 4,669

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

  • Hash Cond: (td_1.turma = turmaagrupada_1.turma)
171. 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.009..0.010 rows=1 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 8kB
173. 9.338 18.676 ↓ 0.0 0 4,669

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

  • Recheck Cond: (turmaorigem = "*SELECT* 1".turma)
174. 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)
175. 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)
176. 18.676 98.049 ↑ 1.0 1 4,669

Bitmap Heap Scan on gradedisciplina (cost=90.69..264.51 rows=1 width=12) (actual time=0.020..0.021 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=4,656
177. 60.697 79.373 ↓ 0.0 0 4,669

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

178. 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))
179.          

SubPlan (for Bitmap Index Scan)

180. 9.338 51.359 ↑ 1.0 1 4,669

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

181. 9.326 42.021 ↓ 0.0 0 4,669

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

  • Hash Cond: (td.turma = turmaagrupada.turma)
182. 0.012 0.012 ↑ 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.012..0.012 rows=1 loops=1)

  • Index Cond: (disciplina = "*SELECT* 1".disciplina)
183. 23.345 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: 1,024 Batches: 1 Memory Usage: 8kB
184. 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)
185. 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)
186. 18.676 18.676 ↑ 1.0 1 4,669

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

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

Bitmap Heap Scan on gradedisciplinacomposta (cost=523.44..1,573.73 rows=1 width=12) (actual time=0.038..0.038 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)))
188. 172.753 172.753 ↓ 0.0 0 4,669

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

189. 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))
190.          

SubPlan (for Bitmap Index Scan)

191. 4.669 37.352 ↑ 1.0 1 4,669

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

192. 0.000 32.683 ↓ 0.0 0 4,669

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

  • Join Filter: ((gdc.gradecurriculargrupooptativadisciplina = td_2.gradecurriculargrupooptativadisciplina) OR (gdc.gradedisciplina = td_2.gradedisciplina))
193. 23.345 32.683 ↓ 0.0 0 4,669

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

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

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

198. 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)
199. 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))
200.          

SubPlan (for Bitmap Index Scan)

201. 60.697 116.725 ↓ 0.0 0 4,669

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

  • Join Filter: ((gdc_1.gradecurriculargrupooptativadisciplina = td_3.gradecurriculargrupooptativadisciplina) OR (gdc_1.gradedisciplina = td_3.gradedisciplina))
202. 56.028 56.028 ↓ 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.005..0.012 rows=19 loops=4,669)

  • Index Cond: (turma = "*SELECT* 1".turma)
203. 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)

204. 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)
205.          

SubPlan (for Nested Loop Left Join)

206. 56.028 1,204.602 ↑ 1.0 1 4,669

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

207. 11.631 1,148.574 ↑ 1.0 1 4,669

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

208. 30.307 1,115.891 ↑ 1.0 1 4,669

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

209. 1,064.532 1,064.532 ↑ 1.0 1 4,669

Seq Scan on cursocoordenador c (cost=0.00..42.09 rows=1 width=4) (actual time=0.129..0.228 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: 1,490
210. 21.052 21.052 ↑ 1.0 1 5,263

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

  • Index Cond: (codigo = c.funcionario)
211. 21.052 21.052 ↑ 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.004..0.004 rows=1 loops=5,263)

  • Index Cond: (codigo = funcionario.pessoa)
212. 37.352 1,162.581 ↑ 1.0 1 4,669

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

213. 7.556 1,125.229 ↑ 1.0 1 4,669

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

214. 40.239 1,101.884 ↑ 1.0 1 4,669

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

215. 1,045.856 1,045.856 ↑ 1.0 1 4,669

Seq Scan on cursocoordenador c_1 (cost=0.00..42.09 rows=1 width=4) (actual time=0.128..0.224 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: 1,490
216. 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)
217. 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 : 16.672 ms
Execution time : 15,671.332 ms