explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Cdfq

Settings
# exclusive inclusive rows x rows loops node
1. 8.172 111,603.488 ↑ 1.0 1 1

Limit (cost=9,437,648.93..9,437,648.93 rows=1 width=3,281) (actual time=111,595.330..111,603.488 rows=1 loops=1)

2. 1.739 111,595.316 ↑ 782,791.0 1 1

Sort (cost=9,437,648.93..9,439,605.91 rows=782,791 width=3,281) (actual time=111,595.257..111,595.316 rows=1 loops=1)

  • Sort Key: arquivo.dataupload DESC
  • Sort Method: top-N heapsort Memory: 25kB
3. 3.519 111,593.577 ↑ 15,655.8 50 1

Unique (cost=9,337,843.08..9,433,734.97 rows=782,791 width=3,281) (actual time=111,588.587..111,593.577 rows=50 loops=1)

4. 3.327 111,590.058 ↑ 15,655.8 50 1

Sort (cost=9,337,843.08..9,339,800.05 rows=782,791 width=3,281) (actual time=111,588.519..111,590.058 rows=50 loops=1)

  • Sort Key: arquivo.codigo, arquivo.codorigem, arquivo.nome, arquivo.apresentarportalcoordenador, arquivo.apresentarportalprofessor, arquivo.apresentarportalaluno, arquivo.descricao, arquivo.descricaoarquivo, arquivo.dataupload, arquivo.datadisponibilizacao, arquivo.dataindisponibilizacao, arquivo.manterdisponibilizacao, arquivo.origem, arquivo.situacao, arquivo.controlardownload, arquivo.responsavelupload, arquivo.disciplina, arquivo.turma, arquivo.extensao, arquivo.apresentardeterminadoperiodo, arquivo.permitirarquivoresposta, arquivo.pastabasearquivo, arquivo.arquivoresposta, arquivo.professor, arquivo.niveleducacional, arquivo.cpfalunodocumentacao, arquivo.cpfrequerimento, arquivo.servidorarquivoonline, arquivo.indice, arquivo.agrupador, arquivo.indiceagrupador, arquivo.arquivoassinadodigitalmente, disciplina.codigo, disciplina.nome, turma.codigo, turma.identificadorturma, usuario.codigo, usuario.nome, professor.codigo, professor.nome, pessoa.codigo, pessoa.nome, curso.codigo, curso.nome, arquivo.servidorarquivoonline, arquivo.arquivoassinadofuncionario, arquivo.arquivoassinadounidadeensino, arquivo.arquivoassinadounidadecertificadora
  • Sort Method: quicksort Memory: 49kB
5. 1.732 111,586.731 ↑ 15,655.8 50 1

Append (cost=53.06..8,153,534.62 rows=782,791 width=3,281) (actual time=110,869.169..111,586.731 rows=50 loops=1)

6. 0.048 1.801 ↓ 0.0 0 1

Unique (cost=53.06..53.18 rows=1 width=347) (actual time=1.747..1.801 rows=0 loops=1)

7. 0.200 1.753 ↓ 0.0 0 1

Sort (cost=53.06..53.07 rows=1 width=347) (actual time=1.700..1.753 rows=0 loops=1)

  • Sort Key: arquivo.codigo, arquivo.codorigem, arquivo.nome, arquivo.apresentarportalcoordenador, arquivo.apresentarportalprofessor, arquivo.apresentarportalaluno, arquivo.descricao, arquivo.descricaoarquivo, arquivo.dataupload, arquivo.datadisponibilizacao, arquivo.dataindisponibilizacao, arquivo.manterdisponibilizacao, arquivo.controlardownload, arquivo.responsavelupload, arquivo.disciplina, arquivo.turma, arquivo.extensao, arquivo.apresentardeterminadoperiodo, arquivo.permitirarquivoresposta, arquivo.pastabasearquivo, arquivo.arquivoresposta, arquivo.niveleducacional, arquivo.cpfalunodocumentacao, arquivo.cpfrequerimento, arquivo.servidorarquivoonline, arquivo.indice, arquivo.agrupador, arquivo.indiceagrupador, arquivo.arquivoassinadodigitalmente, disciplina.codigo, disciplina.nome, turma.codigo, turma.identificadorturma, usuario.codigo, usuario.nome, professor.codigo, professor.nome, pessoa.codigo, pessoa.nome, curso.codigo, curso.nome, arquivo.arquivoassinadofuncionario, arquivo.arquivoassinadounidadeensino, arquivo.arquivoassinadounidadecertificadora
  • Sort Method: quicksort Memory: 25kB
8. 0.045 1.553 ↓ 0.0 0 1

Nested Loop Left Join (cost=10.01..53.05 rows=1 width=347) (actual time=1.496..1.553 rows=0 loops=1)

9. 0.025 1.508 ↓ 0.0 0 1

Nested Loop Left Join (cost=9.59..44.62 rows=1 width=318) (actual time=1.448..1.508 rows=0 loops=1)

  • Join Filter: (arquivo.professor = professor.codigo)
10. 0.074 1.483 ↓ 0.0 0 1

Nested Loop Left Join (cost=9.17..36.17 rows=1 width=288) (actual time=1.401..1.483 rows=0 loops=1)

11. 0.045 1.409 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.88..27.86 rows=1 width=257) (actual time=1.354..1.409 rows=0 loops=1)

12. 0.042 1.364 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.60..19.56 rows=1 width=233) (actual time=1.307..1.364 rows=0 loops=1)

13. 0.528 1.322 ↓ 0.0 0 1

Hash Right Join (cost=8.32..11.25 rows=1 width=210) (actual time=1.260..1.322 rows=0 loops=1)

  • Hash Cond: (curso.codigo = arquivo.curso)
14. 0.000 0.000 ↓ 0.0 0

Seq Scan on curso (cost=0.00..2.67 rows=67 width=21) (never executed)

15. 0.087 0.794 ↓ 0.0 0 1

Hash (cost=8.31..8.31 rows=1 width=205) (actual time=0.730..0.794 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
16. 0.707 0.707 ↓ 0.0 0 1

Index Scan using ch_arquivo_professor on arquivo (cost=0.29..8.31 rows=1 width=205) (actual time=0.651..0.707 rows=0 loops=1)

  • Index Cond: (professor = 123998)
  • Filter: (apresentarportalprofessor AND ((niveleducacional)::text <> ''::text) AND ((origem)::text = 'IN'::text) AND ((situacao)::text = 'AT'::text))
17. 0.000 0.000 ↓ 0.0 0

Index Scan using disciplina_pkey on disciplina (cost=0.28..8.30 rows=1 width=23) (never executed)

  • Index Cond: (arquivo.disciplina = codigo)
18. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using usuario_pkey on usuario (cost=0.29..8.30 rows=1 width=31) (never executed)

  • Index Cond: (arquivo.responsavelupload = codigo)
20. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_pkey on pessoa professor (cost=0.42..8.44 rows=1 width=30) (never executed)

  • Index Cond: (codigo = 123998)
21. 0.000 0.000 ↓ 0.0 0

Index Scan using pessoa_pkey on pessoa (cost=0.42..8.44 rows=1 width=30) (never executed)

  • Index Cond: (arquivo.pessoa = codigo)
22. 381.235 111,583.198 ↑ 15,655.8 50 1

Unique (cost=8,051,718.72..8,141,739.57 rows=782,790 width=347) (actual time=110,867.357..111,583.198 rows=50 loops=1)

23. 1,457.255 111,201.963 ↑ 39.5 19,804 1

Sort (cost=8,051,718.72..8,053,675.70 rows=782,790 width=347) (actual time=110,867.298..111,201.963 rows=19,804 loops=1)

  • Sort Key: arquivo_1.codigo, arquivo_1.codorigem, arquivo_1.nome, arquivo_1.apresentarportalcoordenador, arquivo_1.apresentarportalprofessor, arquivo_1.apresentarportalaluno, arquivo_1.descricao, arquivo_1.descricaoarquivo, arquivo_1.dataupload, arquivo_1.datadisponibilizacao, arquivo_1.dataindisponibilizacao, arquivo_1.manterdisponibilizacao, arquivo_1.controlardownload, arquivo_1.responsavelupload, arquivo_1.disciplina, arquivo_1.turma, arquivo_1.extensao, arquivo_1.apresentardeterminadoperiodo, arquivo_1.permitirarquivoresposta, arquivo_1.pastabasearquivo, arquivo_1.arquivoresposta, arquivo_1.professor, arquivo_1.niveleducacional, arquivo_1.cpfalunodocumentacao, arquivo_1.cpfrequerimento, arquivo_1.servidorarquivoonline, arquivo_1.indice, arquivo_1.agrupador, arquivo_1.indiceagrupador, arquivo_1.arquivoassinadodigitalmente, disciplina_1.codigo, disciplina_1.nome, turma_1.codigo, turma_1.identificadorturma, usuario_1.codigo, usuario_1.nome, professor_1.codigo, professor_1.nome, pessoa_1.codigo, pessoa_1.nome, curso_1.codigo, curso_1.nome, arquivo_1.arquivoassinadofuncionario, arquivo_1.arquivoassinadounidadeensino, arquivo_1.arquivoassinadounidadecertificadora
  • Sort Method: quicksort Memory: 9813kB
24. 1,124.325 109,744.708 ↑ 39.5 19,804 1

Merge Left Join (cost=3,182.49..7,849,338.87 rows=782,790 width=347) (actual time=18,470.281..109,744.708 rows=19,804 loops=1)

  • Merge Cond: (arquivo_1.disciplina = disciplina_1.codigo)
25. 1,330.534 108,620.383 ↑ 39.5 19,804 1

Nested Loop (cost=3,178.90..7,847,147.32 rows=782,790 width=317) (actual time=18,470.127..108,620.383 rows=19,804 loops=1)

26. 332.593 2,707.581 ↓ 6.2 3,636 1

Nested Loop Left Join (cost=1.83..12,536.07 rows=582 width=321) (actual time=4.083..2,707.581 rows=3,636 loops=1)

27. 317.640 2,225.912 ↓ 6.2 3,636 1

Nested Loop Left Join (cost=1.69..12,427.08 rows=582 width=300) (actual time=3.962..2,225.912 rows=3,636 loops=1)

28. 336.956 1,788.284 ↓ 6.2 3,636 1

Nested Loop Left Join (cost=1.27..8,104.45 rows=582 width=278) (actual time=3.841..1,788.284 rows=3,636 loops=1)

29. 368.774 1,345.884 ↓ 6.2 3,636 1

Nested Loop Left Join (cost=0.85..3,781.83 rows=582 width=248) (actual time=3.733..1,345.884 rows=3,636 loops=1)

30. 376.051 788.038 ↓ 6.2 3,636 1

Nested Loop Left Join (cost=0.56..1,504.32 rows=582 width=217) (actual time=3.468..788.038 rows=3,636 loops=1)

31. 208.371 208.371 ↓ 6.2 3,636 1

Index Scan using idx_arquivo_disc_datadisp_dataindisp_parcial on arquivo arquivo_1 (cost=0.28..961.72 rows=582 width=205) (actual time=3.223..208.371 rows=3,636 loops=1)

  • Filter: (apresentarportalprofessor AND ((niveleducacional)::text <> ''::text) AND (COALESCE(professor, 0) <> 123998) AND ((origem)::text = 'IN'::text))
  • Rows Removed by Filter: 147
32. 203.616 203.616 ↑ 1.0 1 3,636

Index Scan using turma_pkey on turma turma_1 (cost=0.28..0.93 rows=1 width=24) (actual time=0.056..0.056 rows=1 loops=3,636)

  • Index Cond: (arquivo_1.turma = codigo)
33. 189.072 189.072 ↑ 1.0 1 3,636

Index Scan using usuario_pkey on usuario usuario_1 (cost=0.29..3.91 rows=1 width=31) (actual time=0.052..0.052 rows=1 loops=3,636)

  • Index Cond: (arquivo_1.responsavelupload = codigo)
34. 105.444 105.444 ↓ 0.0 0 3,636

Index Scan using pessoa_pkey on pessoa professor_1 (cost=0.42..7.43 rows=1 width=30) (actual time=0.029..0.029 rows=0 loops=3,636)

  • Index Cond: (arquivo_1.professor = codigo)
35. 119.988 119.988 ↓ 0.0 0 3,636

Index Scan using pessoa_pkey on pessoa pessoa_1 (cost=0.42..7.43 rows=1 width=30) (actual time=0.033..0.033 rows=0 loops=3,636)

  • Index Cond: (arquivo_1.pessoa = codigo)
36. 149.076 149.076 ↑ 1.0 1 3,636

Index Scan using curso_pkey on curso curso_1 (cost=0.14..0.19 rows=1 width=21) (actual time=0.041..0.041 rows=1 loops=3,636)

  • Index Cond: (arquivo_1.curso = codigo)
37. 1,970.712 104,582.268 ↑ 269.0 5 3,636

Append (cost=3,177.07..13,448.08 rows=1,345 width=0) (actual time=27.038..28.763 rows=5 loops=3,636)

38. 378.144 14,623.992 ↑ 1,231.0 1 3,636

Subquery Scan on *SELECT* 1 (cost=3,177.07..11,135.86 rows=1,231 width=0) (actual time=3.800..4.022 rows=1 loops=3,636)

39. 278.144 14,245.848 ↑ 1,231.0 1 3,636

Result (cost=3,177.07..11,123.55 rows=1,231 width=4) (actual time=3.744..3.918 rows=1 loops=3,636)

  • One-Time Filter: ((arquivo_1.curso IS NULL) AND (arquivo_1.turma IS NULL) AND (arquivo_1.disciplina IS NULL) AND (arquivo_1.professor IS NULL))
40. 876.148 13,967.704 ↑ 1.7 737 4

Hash Join (cost=3,177.07..11,123.55 rows=1,231 width=0) (actual time=3,378.702..3,491.926 rows=737 loops=4)

  • Hash Cond: (htdi.horarioturmadia = htd.codigo)
41. 645.144 1,709.216 ↓ 1.0 4,926 4

Gather (cost=1,000.00..8,915.98 rows=4,852 width=4) (actual time=11.806..427.304 rows=4,926 loops=4)

  • Workers Planned: 2
  • Workers Launched: 2
42. 1,064.072 1,064.072 ↑ 1.2 1,642 12 / 3

Parallel Seq Scan on horarioturmadiaitem htdi (cost=0.00..7,430.78 rows=2,022 width=4) (actual time=16.105..266.018 rows=1,642 loops=12)

  • Filter: (professor = 123998)
  • Rows Removed by Filter: 108872
43. 2,482.732 11,382.340 ↓ 1.0 19,257 4

Hash (cost=1,941.19..1,941.19 rows=18,870 width=4) (actual time=2,845.570..2,845.585 rows=19,257 loops=4)

  • Buckets: 32768 Batches: 1 Memory Usage: 635kB
44. 4,694.248 8,899.608 ↓ 1.0 19,257 4

Nested Loop (cost=16.25..1,941.19 rows=18,870 width=4) (actual time=31.004..2,224.902 rows=19,257 loops=4)

45. 83.682 1,224.160 ↑ 1.0 100 4

Hash Join (cost=15.96..153.25 rows=100 width=4) (actual time=29.319..306.040 rows=100 loops=4)

  • Hash Cond: (t.codigo = ht.turma)
46. 580.736 1,100.244 ↑ 2.0 514 4

Hash Join (cost=3.05..134.08 rows=1,052 width=4) (actual time=1.747..275.061 rows=514 loops=4)

  • Hash Cond: (t.curso = c.codigo)
47. 518.216 518.216 ↑ 1.0 4,147 4

Seq Scan on turma t (cost=0.00..119.47 rows=4,147 width=8) (actual time=0.064..129.554 rows=4,147 loops=4)

48. 0.620 1.292 ↑ 5.7 3 4

Hash (cost=2.84..2.84 rows=17 width=4) (actual time=0.309..0.323 rows=3 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
49. 0.672 0.672 ↑ 5.7 3 4

Seq Scan on curso c (cost=0.00..2.84 rows=17 width=4) (actual time=0.059..0.168 rows=3 loops=4)

  • Filter: ((arquivo_1.niveleducacional)::text = (niveleducacional)::text)
  • Rows Removed by Filter: 64
50. 14.382 40.234 ↑ 1.0 396 1

Hash (cost=7.96..7.96 rows=396 width=8) (actual time=40.164..40.234 rows=396 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 24kB
51. 25.852 25.852 ↑ 1.0 396 1

Seq Scan on horarioturma ht (cost=0.00..7.96 rows=396 width=8) (actual time=0.181..25.852 rows=396 loops=1)

  • Filter: (codigo IS NOT NULL)
52. 2,981.200 2,981.200 ↑ 1.0 193 400

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd (cost=0.29..15.93 rows=195 width=8) (actual time=0.190..7.453 rows=193 loops=400)

  • Index Cond: (horarioturma = ht.codigo)
53. 203.616 1,221.696 ↓ 0.0 0 3,636

Subquery Scan on *SELECT* 2 (cost=131.39..1,318.41 rows=78 width=0) (actual time=0.336..0.336 rows=0 loops=3,636)

54. 112.535 1,018.080 ↓ 0.0 0 3,636

Result (cost=131.39..1,317.63 rows=78 width=4) (actual time=0.280..0.280 rows=0 loops=3,636)

  • One-Time Filter: ((arquivo_1.turma IS NULL) AND (arquivo_1.disciplina IS NULL) AND (arquivo_1.professor IS NULL))
55. 243.816 905.545 ↓ 0.0 0 5

Nested Loop (cost=131.39..1,317.63 rows=78 width=0) (actual time=181.101..181.109 rows=0 loops=5)

56. 237.907 414.775 ↑ 1.9 625 5

Nested Loop (cost=130.97..249.85 rows=1,202 width=4) (actual time=8.158..82.955 rows=625 loops=5)

57. 1.783 44.260 ↑ 2.0 3 5

Nested Loop (cost=130.68..142.57 rows=6 width=4) (actual time=7.990..8.852 rows=3 loops=5)

58. 1.750 1.750 ↓ 0.0 0 5

Seq Scan on curso c_1 (cost=0.00..2.84 rows=1 width=4) (actual time=0.331..0.350 rows=0 loops=5)

  • Filter: (codigo = arquivo_1.curso)
  • Rows Removed by Filter: 67
59. 16.202 40.727 ↓ 2.3 14 1

Hash Join (cost=130.68..139.67 rows=6 width=8) (actual time=37.465..40.727 rows=14 loops=1)

  • Hash Cond: (ht_1.turma = t_1.codigo)
60. 16.254 16.254 ↑ 1.0 396 1

Seq Scan on horarioturma ht_1 (cost=0.00..7.96 rows=396 width=8) (actual time=0.715..16.254 rows=396 loops=1)

  • Filter: (codigo IS NOT NULL)
61. 0.644 8.271 ↑ 3.5 19 1

Hash (cost=129.84..129.84 rows=67 width=8) (actual time=8.228..8.271 rows=19 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
62. 7.627 7.627 ↑ 3.5 19 1

Seq Scan on turma t_1 (cost=0.00..129.84 rows=67 width=8) (actual time=6.443..7.627 rows=19 loops=1)

  • Filter: (curso = arquivo_1.curso)
  • Rows Removed by Filter: 4128
63. 132.608 132.608 ↓ 1.1 223 14

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd_1 (cost=0.29..15.93 rows=195 width=8) (actual time=0.111..9.472 rows=223 loops=14)

  • Index Cond: (horarioturma = ht_1.codigo)
64. 246.954 246.954 ↓ 0.0 0 3,126

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_1 (cost=0.42..0.88 rows=1 width=4) (actual time=0.079..0.079 rows=0 loops=3,126)

  • Index Cond: (horarioturmadia = htd_1.codigo)
  • Filter: (professor = 123998)
  • Rows Removed by Filter: 5
65. 1,087.164 85,307.832 ↑ 2.4 5 3,636

Subquery Scan on *SELECT* 3 (cost=1.27..279.52 rows=12 width=0) (actual time=22.261..23.462 rows=5 loops=3,636)

66. 1,116.328 84,220.668 ↑ 2.4 5 3,636

Result (cost=1.27..279.40 rows=12 width=4) (actual time=22.209..23.163 rows=5 loops=3,636)

  • One-Time Filter: ((arquivo_1.disciplina IS NULL) AND (arquivo_1.professor IS NULL))
67. 24,850.789 83,104.340 ↑ 2.4 5 3,620

Nested Loop (cost=1.27..279.40 rows=12 width=0) (actual time=22.248..22.957 rows=5 loops=3,620)

68. 22,414.900 37,202.740 ↑ 1.6 114 3,620

Nested Loop (cost=0.85..112.39 rows=188 width=4) (actual time=0.490..10.277 rows=114 loops=3,620)

69. 618.344 1,987.380 ↑ 1.0 1 3,620

Nested Loop (cost=0.55..19.45 rows=1 width=4) (actual time=0.350..0.549 rows=1 loops=3,620)

70. 532.959 1,024.460 ↑ 1.0 1 3,620

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.175..0.283 rows=1 loops=3,620)

71. 275.120 275.120 ↑ 1.0 1 3,620

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_2 (cost=0.27..8.29 rows=1 width=8) (actual time=0.054..0.076 rows=1 loops=3,620)

  • Index Cond: (turma = arquivo_1.turma)
  • Filter: (codigo IS NOT NULL)
72. 216.381 216.381 ↑ 1.0 1 2,739

Index Scan using turma_pkey on turma t_2 (cost=0.28..8.30 rows=1 width=8) (actual time=0.048..0.079 rows=1 loops=2,739)

  • Index Cond: (codigo = arquivo_1.turma)
  • Filter: (curso = arquivo_1.curso)
  • Rows Removed by Filter: 0
73. 344.576 344.576 ↑ 1.0 1 2,692

Seq Scan on curso c_2 (cost=0.00..2.84 rows=1 width=4) (actual time=0.088..0.128 rows=1 loops=2,692)

  • Filter: (codigo = arquivo_1.curso)
  • Rows Removed by Filter: 66
74. 12,800.460 12,800.460 ↑ 1.3 153 2,692

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd_2 (cost=0.29..90.99 rows=195 width=8) (actual time=0.062..4.755 rows=153 loops=2,692)

  • Index Cond: (horarioturma = ht_2.codigo)
75. 21,050.811 21,050.811 ↓ 0.0 0 412,761

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_2 (cost=0.42..0.88 rows=1 width=4) (actual time=0.050..0.051 rows=0 loops=412,761)

  • Index Cond: (horarioturmadia = htd_2.codigo)
  • Filter: (professor = 123998)
  • Rows Removed by Filter: 5
76. 210.888 319.968 ↓ 0.0 0 3,636

Subquery Scan on *SELECT* 4 (cost=1.27..143.92 rows=1 width=0) (actual time=0.088..0.088 rows=0 loops=3,636)

77. 106.980 109.080 ↓ 0.0 0 3,636

Result (cost=1.27..143.91 rows=1 width=4) (actual time=0.030..0.030 rows=0 loops=3,636)

  • One-Time Filter: ((arquivo_1.turma IS NULL) AND (arquivo_1.professor IS NULL))
78. 0.465 2.100 ↓ 0.0 0 5

Nested Loop (cost=1.27..143.91 rows=1 width=0) (actual time=0.411..0.420 rows=0 loops=5)

79. 0.445 1.635 ↓ 0.0 0 5

Nested Loop (cost=1.27..141.07 rows=1 width=4) (actual time=0.319..0.327 rows=0 loops=5)

80. 0.380 1.190 ↓ 0.0 0 5

Nested Loop (cost=0.99..128.72 rows=10 width=4) (actual time=0.227..0.238 rows=0 loops=5)

81. 0.560 0.810 ↓ 0.0 0 5

Nested Loop (cost=0.71..125.79 rows=10 width=4) (actual time=0.153..0.162 rows=0 loops=5)

82. 0.250 0.250 ↓ 0.0 0 5

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem htdi_3 (cost=0.42..42.69 rows=10 width=4) (actual time=0.042..0.050 rows=0 loops=5)

  • Index Cond: ((arquivo_1.disciplina = disciplina) AND (professor = 123998))
83. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadia_pkey on horarioturmadia htd_3 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (codigo = htdi_3.horarioturmadia)
84. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_pkey on horarioturma ht_3 (cost=0.27..0.29 rows=1 width=8) (never executed)

  • Index Cond: ((codigo = htd_3.horarioturma) AND (codigo IS NOT NULL))
85. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (codigo = ht_3.turma)
  • Filter: (curso = arquivo_1.curso)
86. 0.000 0.000 ↓ 0.0 0

Seq Scan on curso c_3 (cost=0.00..2.84 rows=1 width=4) (never executed)

  • Filter: (codigo = arquivo_1.curso)
87. 207.252 309.060 ↓ 0.0 0 3,636

Subquery Scan on *SELECT* 5 (cost=1.27..140.60 rows=1 width=0) (actual time=0.085..0.085 rows=0 loops=3,636)

88. 97.219 101.808 ↓ 0.0 0 3,636

Result (cost=1.27..140.59 rows=1 width=4) (actual time=0.027..0.028 rows=0 loops=3,636)

  • One-Time Filter: ((arquivo_1.curso IS NULL) AND (arquivo_1.professor IS NULL))
89. 1.066 4.589 ↓ 0.0 0 13

Nested Loop (cost=1.27..140.59 rows=1 width=0) (actual time=0.350..0.353 rows=0 loops=13)

  • Join Filter: (t_4.curso = c_4.codigo)
90. 0.936 3.523 ↓ 0.0 0 13

Nested Loop (cost=1.27..137.08 rows=1 width=4) (actual time=0.268..0.271 rows=0 loops=13)

91. 0.871 2.587 ↓ 0.0 0 13

Nested Loop (cost=0.99..128.77 rows=1 width=4) (actual time=0.195..0.199 rows=0 loops=13)

92. 1.144 1.716 ↓ 0.0 0 13

Nested Loop (cost=0.71..125.79 rows=10 width=4) (actual time=0.123..0.132 rows=0 loops=13)

93. 0.572 0.572 ↓ 0.0 0 13

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem htdi_4 (cost=0.42..42.69 rows=10 width=4) (actual time=0.040..0.044 rows=0 loops=13)

  • Index Cond: ((arquivo_1.disciplina = disciplina) AND (professor = 123998))
94. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadia_pkey on horarioturmadia htd_4 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (codigo = htdi_4.horarioturmadia)
95. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_pkey on horarioturma ht_4 (cost=0.27..0.30 rows=1 width=8) (never executed)

  • Index Cond: ((codigo = htd_4.horarioturma) AND (codigo IS NOT NULL))
  • Filter: (turma = arquivo_1.turma)
96. 0.000 0.000 ↓ 0.0 0

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

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

Seq Scan on curso c_4 (cost=0.00..2.67 rows=67 width=4) (never executed)

98. 192.708 534.492 ↓ 0.0 0 3,636

Subquery Scan on *SELECT* 6 (cost=4.78..280.21 rows=12 width=0) (actual time=0.147..0.147 rows=0 loops=3,636)

99. 95.018 341.784 ↓ 0.0 0 3,636

Result (cost=4.78..280.09 rows=12 width=4) (actual time=0.094..0.094 rows=0 loops=3,636)

  • One-Time Filter: ((arquivo_1.curso IS NULL) AND (arquivo_1.disciplina IS NULL) AND (arquivo_1.professor IS NULL))
100. 1.053 246.766 ↓ 0.0 0 13

Hash Join (cost=4.78..280.09 rows=12 width=0) (actual time=18.979..18.982 rows=0 loops=13)

  • Hash Cond: (t_5.curso = c_5.codigo)
101. 60.619 245.713 ↓ 0.0 0 13

Nested Loop (cost=1.27..276.55 rows=12 width=4) (actual time=18.898..18.901 rows=0 loops=13)

102. 48.661 124.488 ↑ 3.1 60 13

Nested Loop (cost=0.85..109.54 rows=188 width=8) (actual time=0.402..9.576 rows=60 loops=13)

103. 1.466 2.678 ↓ 0.0 0 13

Nested Loop (cost=0.55..16.60 rows=1 width=8) (actual time=0.168..0.206 rows=0 loops=13)

104. 0.897 0.897 ↓ 0.0 0 13

Index Scan using ch_horarioturma_turma_ano_semestre on horarioturma ht_5 (cost=0.27..8.29 rows=1 width=8) (actual time=0.058..0.069 rows=0 loops=13)

  • Index Cond: (turma = arquivo_1.turma)
  • Filter: (codigo IS NOT NULL)
105. 0.315 0.315 ↑ 1.0 1 3

Index Scan using turma_pkey on turma t_5 (cost=0.28..8.30 rows=1 width=8) (actual time=0.057..0.105 rows=1 loops=3)

  • Index Cond: (codigo = arquivo_1.turma)
106. 73.149 73.149 ↓ 1.3 259 3

Index Scan using fk_horarioturmadia_horarioturma on horarioturmadia htd_5 (cost=0.29..90.99 rows=195 width=8) (actual time=0.627..24.383 rows=259 loops=3)

  • Index Cond: (horarioturma = ht_5.codigo)
107. 60.606 60.606 ↓ 0.0 0 777

Index Scan using idx_horturdiaitem_horturmdia on horarioturmadiaitem htdi_5 (cost=0.42..0.88 rows=1 width=4) (actual time=0.078..0.078 rows=0 loops=777)

  • Index Cond: (horarioturmadia = htd_5.codigo)
  • Filter: (professor = 123998)
  • Rows Removed by Filter: 5
108. 0.000 0.000 ↓ 0.0 0

Hash (cost=2.67..2.67 rows=67 width=4) (never executed)

109. 0.000 0.000 ↓ 0.0 0

Seq Scan on curso c_5 (cost=0.00..2.67 rows=67 width=4) (never executed)

110. 196.344 294.516 ↓ 0.0 0 3,636

Subquery Scan on *SELECT* 7 (cost=1.41..142.83 rows=10 width=0) (actual time=0.081..0.081 rows=0 loops=3,636)

111. 96.620 98.172 ↓ 0.0 0 3,636

Result (cost=1.41..142.73 rows=10 width=4) (actual time=0.027..0.027 rows=0 loops=3,636)

  • One-Time Filter: ((arquivo_1.curso IS NULL) AND (arquivo_1.turma IS NULL) AND (arquivo_1.professor IS NULL))
112. 0.364 1.552 ↓ 0.0 0 4

Nested Loop (cost=1.41..142.73 rows=10 width=0) (actual time=0.378..0.388 rows=0 loops=4)

113. 0.344 1.188 ↓ 0.0 0 4

Nested Loop (cost=1.27..141.01 rows=10 width=4) (actual time=0.287..0.297 rows=0 loops=4)

114. 0.320 0.844 ↓ 0.0 0 4

Nested Loop (cost=0.99..128.72 rows=10 width=4) (actual time=0.200..0.211 rows=0 loops=4)

115. 0.304 0.524 ↓ 0.0 0 4

Nested Loop (cost=0.71..125.79 rows=10 width=4) (actual time=0.120..0.131 rows=0 loops=4)

116. 0.220 0.220 ↓ 0.0 0 4

Index Scan using idx_horturdiaitem_disc_prof on horarioturmadiaitem htdi_6 (cost=0.42..42.69 rows=10 width=4) (actual time=0.040..0.055 rows=0 loops=4)

  • Index Cond: ((arquivo_1.disciplina = disciplina) AND (professor = 123998))
117. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturmadia_pkey on horarioturmadia htd_6 (cost=0.29..8.31 rows=1 width=8) (never executed)

  • Index Cond: (codigo = htdi_6.horarioturmadia)
118. 0.000 0.000 ↓ 0.0 0

Index Scan using horarioturma_pkey on horarioturma ht_6 (cost=0.27..0.29 rows=1 width=8) (never executed)

  • Index Cond: ((codigo = htd_6.horarioturma) AND (codigo IS NOT NULL))
119. 0.000 0.000 ↓ 0.0 0

Index Scan using turma_pkey on turma t_6 (cost=0.28..1.23 rows=1 width=8) (never executed)

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

Index Only Scan using curso_pkey on curso c_6 (cost=0.14..0.16 rows=1 width=4) (never executed)

  • Index Cond: (codigo = t_6.curso)
  • Heap Fetches: 0
121. 0.000 0.000 ↓ 0.0 0

Index Scan using disciplina_pkey on disciplina disciplina_1 (cost=0.28..129.10 rows=2,746 width=23) (never executed)

Planning time : 109.112 ms
Execution time : 111,621.503 ms