explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B5r7

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop (cost=6,037.54..71,158.58 rows=1 width=62) (actual rows= loops=)

  • Join Filter: ((d.id_discente = mc.id_discente) AND (crc_comp.id_componente_curricular = mc.id_componente_curricular))
2. 0.000 0.000 ↓ 0.0

Hash Right Join (cost=6,037.54..71,122.69 rows=7 width=58) (actual rows= loops=)

  • Hash Cond: ((movimentacao_aluno.id_discente = m.id_discente) AND ((max(movimentacao_aluno.data_ocorrencia)) = m.data_ocorrencia))
3. 0.000 0.000 ↓ 0.0

GroupAggregate (cost=0.00..61,131.27 rows=225,936 width=12) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Index Scan using idx_movimentacao_aluno_id_discente_ano_periodo_ativo on movimentacao_aluno (cost=0.00..55,717.89 rows=630,803 width=12) (actual rows= loops=)

  • Index Cond: (ativo = true)
  • Filter: ((data_retorno IS NULL) AND (ativo IS TRUE))
5. 0.000 0.000 ↓ 0.0

Hash (cost=6,037.43..6,037.43 rows=7 width=66) (actual rows= loops=)

6. 0.000 0.000 ↓ 0.0

Nested Loop (cost=156.26..6,037.43 rows=7 width=66) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Merge Join (cost=156.26..6,034.62 rows=4 width=42) (actual rows= loops=)

  • Merge Cond: (crc.id_matriz = ovs.id_matriz_curricular_ovs)
  • Join Filter: (cs.id_oferta_vagas_inscrito_sisu_cs = ovs.id_oferta_vagas_sisu_ovs)
8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..17,750.21 rows=9,697 width=46) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..11,186.94 rows=9,499 width=30) (actual rows= loops=)

10. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..4,176.24 rows=9,499 width=26) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.00..2,113.31 rows=65 width=16) (actual rows= loops=)

12. 0.000 0.000 ↓ 0.0

Index Scan using idx_curriculo_id_matriz_btree on curriculo crc (cost=0.00..154.05 rows=116 width=8) (actual rows= loops=)

  • Filter: ((vigente IS TRUE) AND (ativo IS TRUE))
13. 0.000 0.000 ↓ 0.0

Index Scan using fki_id_curriculo_fk on curriculo_componente crc_comp (cost=0.00..16.88 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id_curriculo = crc.id_curriculo)
  • Filter: ((obrigatoria IS TRUE) AND (semestre_oferta = 1))
14. 0.000 0.000 ↓ 0.0

Index Scan using idx_discente_id_curriculo_btree on discente d (cost=0.00..29.96 rows=178 width=22) (actual rows= loops=)

  • Index Cond: (id_curriculo = crc_comp.id_curriculo)
  • Filter: (nivel = 'G'::bpchar)
15. 0.000 0.000 ↓ 0.0

Index Scan using pessoa_pkey on pessoa p (cost=0.00..0.73 rows=1 width=12) (actual rows= loops=)

  • Index Cond: (id_pessoa = d.id_pessoa)
16. 0.000 0.000 ↓ 0.0

Index Scan using idx_candidato_sisu_cs_cpf_opcao on tb_candidato_sisu_cs cs (cost=0.00..0.67 rows=2 width=24) (actual rows= loops=)

  • Index Cond: (num_cpf_cs = p.cpf_cnpj)
17. 0.000 0.000 ↓ 0.0

Sort (cost=156.26..158.73 rows=990 width=8) (actual rows= loops=)

  • Sort Key: ovs.id_matriz_curricular_ovs
18. 0.000 0.000 ↓ 0.0

Seq Scan on tb_oferta_vagas_sisu_ovs ovs (cost=0.00..107.00 rows=990 width=8) (actual rows= loops=)

  • Filter: (id_edicao_sisu_ovs = 4)
19. 0.000 0.000 ↓ 0.0

Index Scan using idx_movimentacao_aluno_id_discente_ano_periodo_ativo on movimentacao_aluno m (cost=0.00..0.68 rows=2 width=24) (actual rows= loops=)

  • Index Cond: ((id_discente = d.id_discente) AND (ativo = true))
  • Filter: ((data_retorno IS NULL) AND (ativo IS TRUE))
20. 0.000 0.000 ↓ 0.0

Index Scan using turma_discente_sitmat on matricula_componente mc (cost=0.00..4.42 rows=47 width=16) (actual rows= loops=)

  • Index Cond: ((id_discente = m.id_discente) AND (id_situacao_matricula = ANY ('{4,21,22,23}'::integer[])))