explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BXlR

Settings
# exclusive inclusive rows x rows loops node
1. 9.410 16,864.935 ↓ 266.0 266 1

Nested Loop (cost=6,037.54..71,158.58 rows=1 width=62) (actual time=15,211.517..16,864.935 rows=266 loops=1)

  • Join Filter: ((d.id_discente = mc.id_discente) AND (crc_comp.id_componente_curricular = mc.id_componente_curricular))
  • Rows Removed by Join Filter: 7043
2. 295.914 16,842.277 ↓ 78.9 552 1

Hash Right Join (cost=6,037.54..71,122.69 rows=7 width=58) (actual time=15,211.440..16,842.277 rows=552 loops=1)

  • Hash Cond: ((movimentacao_aluno.id_discente = m.id_discente) AND ((max(movimentacao_aluno.data_ocorrencia)) = m.data_ocorrencia))
3. 853.828 1,922.006 ↓ 1.5 334,961 1

GroupAggregate (cost=0.00..61,131.27 rows=225,936 width=12) (actual time=0.030..1,922.006 rows=334,961 loops=1)

4. 1,068.178 1,068.178 ↑ 1.0 628,613 1

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 time=0.019..1,068.178 rows=628,613 loops=1)

  • Index Cond: (ativo = true)
  • Filter: ((data_retorno IS NULL) AND (ativo IS TRUE))
  • Rows Removed by Filter: 99750
5. 1.578 14,624.357 ↓ 78.9 552 1

Hash (cost=6,037.43..6,037.43 rows=7 width=66) (actual time=14,624.357..14,624.357 rows=552 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 57kB
6. 2.895 14,622.779 ↓ 78.9 552 1

Nested Loop (cost=156.26..6,037.43 rows=7 width=66) (actual time=62.640..14,622.779 rows=552 loops=1)

7. 3,231.693 14,615.084 ↓ 150.0 600 1

Merge Join (cost=156.26..6,034.62 rows=4 width=42) (actual time=23.759..14,615.084 rows=600 loops=1)

  • 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)
  • Rows Removed by Join Filter: 3358461
8. 1,569.817 8,817.474 ↓ 39.8 385,513 1

Nested Loop (cost=0.00..17,750.21 rows=9,697 width=46) (actual time=0.130..8,817.474 rows=385,513 loops=1)

9. 1,426.615 5,157.352 ↓ 44.0 418,061 1

Nested Loop (cost=0.00..11,186.94 rows=9,499 width=30) (actual time=0.092..5,157.352 rows=418,061 loops=1)

10. 677.612 1,640.432 ↓ 44.0 418,061 1

Nested Loop (cost=0.00..4,176.24 rows=9,499 width=26) (actual time=0.077..1,640.432 rows=418,061 loops=1)

11. 2.315 14.292 ↓ 14.5 941 1

Nested Loop (cost=0.00..2,113.31 rows=65 width=16) (actual time=0.044..14.292 rows=941 loops=1)

12. 1.901 1.901 ↓ 2.0 229 1

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

  • Filter: ((vigente IS TRUE) AND (ativo IS TRUE))
  • Rows Removed by Filter: 1230
13. 10.076 10.076 ↓ 4.0 4 229

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

  • Index Cond: (id_curriculo = crc.id_curriculo)
  • Filter: ((obrigatoria IS TRUE) AND (semestre_oferta = 1))
  • Rows Removed by Filter: 55
14. 948.528 948.528 ↓ 2.5 444 941

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

  • Index Cond: (id_curriculo = crc_comp.id_curriculo)
  • Filter: (nivel = 'G'::bpchar)
  • Rows Removed by Filter: 13
15. 2,090.305 2,090.305 ↑ 1.0 1 418,061

Index Scan using pessoa_pkey on pessoa p (cost=0.00..0.73 rows=1 width=12) (actual time=0.004..0.005 rows=1 loops=418,061)

  • Index Cond: (id_pessoa = d.id_pessoa)
16. 2,090.305 2,090.305 ↑ 2.0 1 418,061

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 time=0.004..0.005 rows=1 loops=418,061)

  • Index Cond: (num_cpf_cs = p.cpf_cnpj)
17. 2,564.447 2,565.917 ↓ 3,392.5 3,358,584 1

Sort (cost=156.26..158.73 rows=990 width=8) (actual time=2.409..2,565.917 rows=3,358,584 loops=1)

  • Sort Key: ovs.id_matriz_curricular_ovs
  • Sort Method: quicksort Memory: 71kB
18. 1.470 1.470 ↑ 1.0 990 1

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

  • Filter: (id_edicao_sisu_ovs = 4)
  • Rows Removed by Filter: 2530
19. 4.800 4.800 ↑ 2.0 1 600

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 time=0.007..0.008 rows=1 loops=600)

  • Index Cond: ((id_discente = d.id_discente) AND (ativo = true))
  • Filter: ((data_retorno IS NULL) AND (ativo IS TRUE))
  • Rows Removed by Filter: 0
20. 13.248 13.248 ↑ 3.6 13 552

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

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