explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GQOg : ubuntu

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 21.739 ↑ 1.0 1 1

Limit (cost=65.54..65.66 rows=1 width=382) (actual time=21.738..21.739 rows=1 loops=1)

2. 0.000 21.737 ↑ 1.0 1 1

Unique (cost=65.54..65.66 rows=1 width=382) (actual time=21.737..21.737 rows=1 loops=1)

3. 0.097 21.737 ↑ 1.0 1 1

Sort (cost=65.54..65.54 rows=1 width=382) (actual time=21.736..21.737 rows=1 loops=1)

  • Sort Key: arquivo.dataupload DESC, arquivo.codigo, arquivo.codorigem, arquivo.nome, arquivo.apresentarportalcoordenador, arquivo.apresentarportalprofessor, arquivo.apresentarportalaluno, arquivo.descricao, arquivo.descricaoarquivo, 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.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.arquivoassinadofuncionario, arquivo.arquivoassinadounidadeensino, arquivo.arquivoassinadounidadecertificadora
  • Sort Method: quicksort Memory: 27kB
4. 0.003 21.640 ↓ 6.0 6 1

Nested Loop Left Join (cost=10.35..65.53 rows=1 width=382) (actual time=8.017..21.640 rows=6 loops=1)

5. 0.005 21.631 ↓ 6.0 6 1

Nested Loop Left Join (cost=10.08..60.82 rows=1 width=326) (actual time=8.013..21.631 rows=6 loops=1)

6. 0.004 21.620 ↓ 6.0 6 1

Nested Loop Left Join (cost=9.66..58.18 rows=1 width=305) (actual time=8.006..21.620 rows=6 loops=1)

7. 0.011 21.610 ↓ 6.0 6 1

Nested Loop Left Join (cost=9.23..55.54 rows=1 width=276) (actual time=8.001..21.610 rows=6 loops=1)

8. 0.006 20.717 ↓ 6.0 6 1

Nested Loop Left Join (cost=8.81..52.90 rows=1 width=246) (actual time=7.549..20.717 rows=6 loops=1)

9. 0.012 20.705 ↓ 6.0 6 1

Nested Loop Left Join (cost=8.53..50.40 rows=1 width=232) (actual time=7.542..20.705 rows=6 loops=1)

10. 18.883 20.687 ↓ 6.0 6 1

Index Scan using idx_arquivo_origem on arquivo (cost=8.24..47.90 rows=1 width=194) (actual time=7.534..20.687 rows=6 loops=1)

  • Index Cond: ((origem)::text = 'IN'::text)
  • Filter: (apresentarportalaluno AND (((niveleducacional IS NOT NULL) AND (hashed SubPlan 1)) OR (niveleducacional IS NULL)) AND (((curso IS NOT NULL) AND (hashed SubPlan 2)) OR (curso IS NULL)) AND ((situacao)::text = 'AT'::text) AND (((turma IS NOT NULL) AND (disciplina IS NOT NULL) AND (alternatives: SubPlan 3 or hashed SubPlan 4)) OR ((turma IS NOT NULL) AND (disciplina IS NULL) AND (alternatives: SubPlan 5 or hashed SubPlan 6)) OR ((turma IS NULL) AND (disciplina IS NOT NULL) AND (alternatives: SubPlan 7 or hashed SubPlan 8)) OR ((turma IS NULL) AND (disciplina IS NULL))))
  • Rows Removed by Filter: 33
11.          

SubPlan (for Index Scan)

12. 0.001 1.804 ↑ 1.0 1 1

Unique (cost=5.15..5.16 rows=1 width=3) (actual time=1.804..1.804 rows=1 loops=1)

13. 0.020 1.803 ↑ 1.0 1 1

Sort (cost=5.15..5.15 rows=1 width=3) (actual time=1.803..1.803 rows=1 loops=1)

  • Sort Key: curso_1.niveleducacional
  • Sort Method: quicksort Memory: 25kB
14. 0.005 1.783 ↑ 1.0 1 1

Nested Loop (cost=0.70..5.14 rows=1 width=3) (actual time=1.782..1.783 rows=1 loops=1)

15. 1.761 1.761 ↑ 1.0 1 1

Index Scan using matricula_pkey on matricula (cost=0.42..2.64 rows=1 width=4) (actual time=1.761..1.761 rows=1 loops=1)

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
16. 0.017 0.017 ↑ 1.0 1 1

Index Scan using curso_pkey on curso curso_1 (cost=0.28..2.49 rows=1 width=7) (actual time=0.017..0.017 rows=1 loops=1)

  • Index Cond: (codigo = matricula.curso)
17. 0.000 0.000 ↓ 0.0 0

Unique (cost=2.65..2.65 rows=1 width=4) (never executed)

18. 0.000 0.000 ↓ 0.0 0

Sort (cost=2.65..2.65 rows=1 width=4) (never executed)

  • Sort Key: matricula_1.curso
19. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula matricula_1 (cost=0.42..2.64 rows=1 width=4) (never executed)

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
20. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..5.30 rows=1 width=0) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_2 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
22. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina (cost=0.43..2.65 rows=1 width=14) (never executed)

  • Index Cond: ((turma = arquivo.turma) AND (disciplina = arquivo.disciplina) AND (matricula = '0414770LC000001'::text))
  • Heap Fetches: 0
23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..27.01 rows=21 width=8) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_3 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodoturmadisciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_1 (cost=0.43..24.16 rows=21 width=22) (never executed)

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
26. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..15.54 rows=1 width=0) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_4 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
28. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_2 (cost=0.43..12.89 rows=1 width=14) (never executed)

  • Index Cond: ((turma = arquivo.turma) AND (matricula = '0414770LC000001'::text))
  • Heap Fetches: 0
29. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.85..27.01 rows=21 width=4) (never executed)

30. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_5 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
31. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodoturmadisciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_3 (cost=0.43..24.16 rows=21 width=18) (never executed)

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
32. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=13.25..16.59 rows=1 width=0) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_6 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
34. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_4 (cost=12.83..13.94 rows=1 width=14) (never executed)

  • Recheck Cond: (((matricula)::text = '0414770LC000001'::text) AND (disciplina = arquivo.disciplina))
35. 0.000 0.000 ↓ 0.0 0

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

36. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
37. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on unique_matriculaperiodoturmadisciplina_disc_matriculaperi_turma (cost=0.00..10.89 rows=808 width=0) (never executed)

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

Nested Loop (cost=0.85..27.01 rows=21 width=4) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Index Only Scan using matricula_pkey on matricula matricula_7 (cost=0.42..2.64 rows=1 width=14) (never executed)

  • Index Cond: (matricula = '0414770LC000001'::text)
  • Heap Fetches: 0
40. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_matriculaperiodoturmadisciplina_matricula on matriculaperiodoturmadisciplina matriculaperiodoturmadisciplina_5 (cost=0.43..24.16 rows=21 width=18) (never executed)

  • Index Cond: ((matricula)::text = '0414770LC000001'::text)
41. 0.006 0.006 ↓ 0.0 0 6

Index Scan using disciplina_pkey on disciplina (cost=0.28..2.50 rows=1 width=50) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (codigo = arquivo.disciplina)
42. 0.006 0.006 ↓ 0.0 0 6

Index Scan using turma_pkey on turma (cost=0.29..2.51 rows=1 width=14) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (codigo = arquivo.turma)
43. 0.882 0.882 ↑ 1.0 1 6

Index Scan using usuario_pkey on usuario (cost=0.42..2.64 rows=1 width=30) (actual time=0.147..0.147 rows=1 loops=6)

  • Index Cond: (codigo = arquivo.responsavelupload)
44. 0.006 0.006 ↓ 0.0 0 6

Index Scan using pessoa_pkey on pessoa professor (cost=0.42..2.64 rows=1 width=29) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (codigo = arquivo.professor)
45. 0.006 0.006 ↓ 0.0 0 6

Index Scan using pessoa_pkey on pessoa (cost=0.42..2.64 rows=1 width=29) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (codigo = arquivo.pessoa)
46. 0.006 0.006 ↓ 0.0 0 6

Index Scan using curso_pkey on curso (cost=0.28..2.49 rows=1 width=53) (actual time=0.001..0.001 rows=0 loops=6)

  • Index Cond: (codigo = arquivo.curso)
Planning time : 117.770 ms
Execution time : 22.408 ms