explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8qfM

Settings
# exclusive inclusive rows x rows loops node
1. 0.382 8,906.891 ↑ 7.3 114 1

Sort (cost=140,537.69..140,539.77 rows=832 width=235) (actual time=8,906.858..8,906.891 rows=114 loops=1)

  • Sort Key: p.nome
  • Sort Method: quicksort Memory: 57kB
2. 0.293 8,906.509 ↑ 7.3 114 1

Nested Loop Left Join (cost=97,044.88..140,497.34 rows=832 width=235) (actual time=8,813.519..8,906.509 rows=114 loops=1)

3. 0.243 8,905.304 ↑ 7.3 114 1

Nested Loop Left Join (cost=97,044.59..139,910.99 rows=832 width=138) (actual time=8,813.481..8,905.304 rows=114 loops=1)

4. 0.222 8,903.921 ↑ 3.6 114 1

Nested Loop Left Join (cost=97,033.58..133,643.62 rows=416 width=142) (actual time=8,813.436..8,903.921 rows=114 loops=1)

5. 0.109 8,903.015 ↑ 1.8 114 1

Nested Loop Left Join (cost=96,898.23..103,834.30 rows=208 width=123) (actual time=8,813.410..8,903.015 rows=114 loops=1)

6. 0.077 8,901.994 ↑ 1.8 114 1

Nested Loop Left Join (cost=96,897.81..103,697.90 rows=208 width=123) (actual time=8,813.364..8,901.994 rows=114 loops=1)

7. 0.143 8,901.803 ↑ 1.8 114 1

Nested Loop Left Join (cost=96,897.53..103,628.07 rows=208 width=123) (actual time=8,813.358..8,901.803 rows=114 loops=1)

8. 0.103 8,901.318 ↑ 1.8 114 1

Nested Loop Left Join (cost=96,897.25..103,498.62 rows=208 width=123) (actual time=8,813.353..8,901.318 rows=114 loops=1)

9. 0.185 8,900.189 ↑ 1.8 114 1

Nested Loop (cost=96,896.96..103,413.60 rows=208 width=119) (actual time=8,813.328..8,900.189 rows=114 loops=1)

10. 0.131 8,899.662 ↑ 1.8 114 1

Nested Loop (cost=96,896.68..103,347.58 rows=208 width=84) (actual time=8,813.307..8,899.662 rows=114 loops=1)

11. 0.183 8,898.163 ↑ 1.8 114 1

Hash Join (cost=96,896.26..102,693.32 rows=208 width=61) (actual time=8,813.271..8,898.163 rows=114 loops=1)

  • Hash Cond: (d.id_curso = c.id_curso)
12. 5.950 8,896.902 ↑ 1.8 114 1

Nested Loop (cost=96,867.30..102,661.58 rows=208 width=44) (actual time=8,812.123..8,896.902 rows=114 loops=1)

13. 37.415 8,849.842 ↓ 2.4 8,222 1

Hash Join (cost=96,866.88..100,488.13 rows=3,380 width=24) (actual time=8,778.632..8,849.842 rows=8,222 loops=1)

  • Hash Cond: (stm.id_matricula_componente = mc.id_matricula_componente)
14. 52.575 52.575 ↓ 1.0 105,771 1

Seq Scan on solicitacao_trancamento_matricula stm (cost=0.00..3,191.98 rows=105,458 width=16) (actual time=0.029..52.575 rows=105,771 loops=1)

  • Filter: (situacao <> 3)
  • Rows Removed by Filter: 3,450
15. 98.362 8,759.852 ↓ 1.1 170,088 1

Hash (cost=94,853.25..94,853.25 rows=161,091 width=16) (actual time=8,759.852..8,759.852 rows=170,088 loops=1)

  • Buckets: 262,144 Batches: 1 Memory Usage: 9,958kB
16. 327.604 8,661.490 ↓ 1.1 170,088 1

Bitmap Heap Scan on matricula_componente mc (cost=5,135.62..94,853.25 rows=161,091 width=16) (actual time=8,357.809..8,661.490 rows=170,088 loops=1)

  • Recheck Cond: ((ano = 2,018) AND (periodo = 1))
  • Heap Blocks: exact=31,717
17. 8,333.886 8,333.886 ↓ 1.1 181,243 1

Bitmap Index Scan on idxp_matricula_componente_ano_periodo_situacao (cost=0.00..5,095.34 rows=161,091 width=0) (actual time=8,333.886..8,333.886 rows=181,243 loops=1)

  • Index Cond: ((ano = 2,018) AND (periodo = 1))
18. 41.110 41.110 ↓ 0.0 0 8,222

Index Scan using discente_pkey on discente d (cost=0.42..0.63 rows=1 width=24) (actual time=0.005..0.005 rows=0 loops=8,222)

  • Index Cond: (id_discente = mc.id_discente)
  • Filter: (nivel = ANY ('{E,D}'::bpchar[]))
  • Rows Removed by Filter: 1
19. 0.436 1.078 ↓ 1.0 504 1

Hash (cost=22.87..22.87 rows=487 width=25) (actual time=1.078..1.078 rows=504 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 37kB
20. 0.642 0.642 ↓ 1.0 504 1

Seq Scan on curso c (cost=0.00..22.87 rows=487 width=25) (actual time=0.047..0.642 rows=504 loops=1)

21. 1.368 1.368 ↑ 1.0 1 114

Index Scan using pessoa_pkey on pessoa p (cost=0.42..3.14 rows=1 width=31) (actual time=0.012..0.012 rows=1 loops=114)

  • Index Cond: (id_pessoa = d.id_pessoa)
22. 0.342 0.342 ↑ 1.0 1 114

Index Scan using unidade_pkey on unidade u (cost=0.28..0.31 rows=1 width=43) (actual time=0.003..0.003 rows=1 loops=114)

  • Index Cond: (id_unidade = d.id_gestora_academica)
23. 1.026 1.026 ↓ 0.0 0 114

Index Scan using idx_discente on orientacao_academica oa (cost=0.29..0.40 rows=1 width=12) (actual time=0.009..0.009 rows=0 loops=114)

  • Index Cond: (id_discente = d.id_discente)
  • Filter: ((NOT cancelado) AND (tipoorientacao = 'O'::bpchar) AND ((fim IS NULL) OR (fim >= ('now'::cstring)::date)))
  • Rows Removed by Filter: 1
24. 0.342 0.342 ↓ 0.0 0 114

Index Scan using servidor_pkey on servidor s (cost=0.29..0.61 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=114)

  • Index Cond: (oa.id_servidor = id_servidor)
25. 0.114 0.114 ↓ 0.0 0 114

Index Scan using docente_externo_pkey on docente_externo de (cost=0.28..0.33 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=114)

  • Index Cond: (id_docente_externo = oa.id_docente_externo)
26. 0.912 0.912 ↑ 1.0 1 114

Index Scan using turma_pkey on turma t (cost=0.42..0.65 rows=1 width=8) (actual time=0.007..0.008 rows=1 loops=114)

  • Index Cond: (id_turma = mc.id_turma)
27. 0.228 0.684 ↓ 0.0 0 114

Bitmap Heap Scan on pessoa pe (cost=135.35..143.29 rows=2 width=31) (actual time=0.006..0.006 rows=0 loops=114)

  • Recheck Cond: ((id_pessoa = s.id_pessoa) OR (id_pessoa = de.id_pessoa))
  • Heap Blocks: exact=39
28. 0.228 0.456 ↓ 0.0 0 114

BitmapOr (cost=135.35..135.35 rows=2 width=0) (actual time=0.004..0.004 rows=0 loops=114)

29. 0.228 0.228 ↓ 0.0 0 114

Bitmap Index Scan on pessoa_pkey (cost=0.00..0.85 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=114)

  • Index Cond: (id_pessoa = s.id_pessoa)
30. 0.000 0.000 ↓ 0.0 0 114

Bitmap Index Scan on pessoa_pkey (cost=0.00..1.80 rows=1 width=0) (actual time=0.000..0.000 rows=0 loops=114)

  • Index Cond: (id_pessoa = de.id_pessoa)
31. 0.456 1.140 ↑ 2.0 1 114

Bitmap Heap Scan on componente_curricular cc (cost=11.02..15.05 rows=2 width=8) (actual time=0.010..0.010 rows=1 loops=114)

  • Recheck Cond: ((t.id_disciplina = id_disciplina) OR (mc.id_componente_curricular = id_disciplina))
  • Heap Blocks: exact=114
32. 0.114 0.684 ↓ 0.0 0 114

BitmapOr (cost=11.02..11.02 rows=2 width=0) (actual time=0.006..0.006 rows=0 loops=114)

33. 0.456 0.456 ↑ 1.0 1 114

Bitmap Index Scan on disciplina_pkey (cost=0.00..0.30 rows=1 width=0) (actual time=0.004..0.004 rows=1 loops=114)

  • Index Cond: (t.id_disciplina = id_disciplina)
34. 0.114 0.114 ↑ 1.0 1 114

Bitmap Index Scan on disciplina_pkey (cost=0.00..0.30 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=114)

  • Index Cond: (mc.id_componente_curricular = id_disciplina)
35. 0.912 0.912 ↑ 1.0 1 114

Index Scan using disciplina_detalhes_pkey on componente_curricular_detalhes ccd (cost=0.29..0.69 rows=1 width=45) (actual time=0.008..0.008 rows=1 loops=114)

  • Index Cond: (cc.id_detalhe = id_componente_detalhes)
Planning time : 50.116 ms
Execution time : 8,908.837 ms