explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9G6e

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 8,797.546 ↓ 0.0 0 1

HashAggregate (cost=53.01..53.02 rows=1 width=47) (actual time=8,797.546..8,797.546 rows=0 loops=1)

  • Group Key: funcionario.matricula, funcionario.pessoa, funcionario.dataadmissao, funcionario.codigo, funcionario.exercecargoadministrativo, funcionario.nomebanco, funcionario.numerobancorecebimento, funcionario.numeroagenciarecebimento, funcionario.contacorrenterecebimento, funcionario.codigoant, funcionario.codigoantsei, funcionario.remover, funcionario.observacao, funcionario.escolaridade, funcionario.arquivoassinatura, funcionario.empresarecebimento, funcionario.cnpjempresarecebimento, funcionario.digitoagenciarecebimento, funcionario.digitocorrenterecebimento, funcionario.operacaobancaria
2. 0.002 8,797.545 ↓ 0.0 0 1

Nested Loop (cost=15.76..52.96 rows=1 width=47) (actual time=8,797.545..8,797.545 rows=0 loops=1)

3. 0.000 8,797.543 ↓ 0.0 0 1

Nested Loop (cost=15.20..48.12 rows=1 width=60) (actual time=8,797.543..8,797.543 rows=0 loops=1)

4. 0.245 8,797.543 ↓ 0.0 0 1

Nested Loop (cost=14.91..39.81 rows=1 width=61) (actual time=8,797.543..8,797.543 rows=0 loops=1)

5. 0.452 8,795.593 ↓ 341.0 341 1

Nested Loop (cost=14.62..33.04 rows=1 width=55) (actual time=8,793.811..8,795.593 rows=341 loops=1)

  • Join Filter: (horarioturmadetalhado.turma = matriculaperiodoturmadisciplina.turma)
6. 0.021 8,793.923 ↓ 6.0 6 1

Nested Loop Left Join (cost=14.20..24.82 rows=1 width=67) (actual time=8,793.768..8,793.923 rows=6 loops=1)

7. 0.020 8,793.830 ↓ 6.0 6 1

Nested Loop (cost=13.91..24.50 rows=1 width=71) (actual time=8,793.713..8,793.830 rows=6 loops=1)

8. 0.039 8,793.774 ↓ 6.0 6 1

Nested Loop (cost=13.50..21.75 rows=1 width=75) (actual time=8,793.697..8,793.774 rows=6 loops=1)

  • Join Filter: (horarioturmadetalhado.professor = funcionario.pessoa)
9. 0.014 8,793.711 ↓ 6.0 6 1

Nested Loop (cost=13.22..21.28 rows=1 width=28) (actual time=8,793.681..8,793.711 rows=6 loops=1)

10. 0.114 8,793.597 ↓ 5.0 5 1

HashAggregate (cost=12.80..12.81 rows=1 width=16) (actual time=8,793.591..8,793.597 rows=5 loops=1)

  • Group Key: horarioturmadetalhado.horarioturma, horarioturmadetalhado.disciplina, horarioturmadetalhado.professor, horarioturmadetalhado.turma
11. 8,793.483 8,793.483 ↓ 22.0 110 1

Function Scan on horarioturmadetalhado (cost=0.25..12.75 rows=5 width=16) (actual time=8,660.716..8,793.483 rows=110 loops=1)

  • Filter: (disciplina = 59)
  • Rows Removed by Filter: 456828
12. 0.100 0.100 ↑ 1.0 1 5

Index Scan using idx_registroaula_tur_dis_dat_prof on registroaula ra (cost=0.42..8.45 rows=1 width=16) (actual time=0.017..0.020 rows=1 loops=5)

  • Index Cond: ((turma = horarioturmadetalhado.turma) AND (disciplina = 59) AND (professor = horarioturmadetalhado.professor))
13. 0.024 0.024 ↑ 1.0 1 6

Index Scan using idx_funcionario_pessoa on funcionario (cost=0.28..0.46 rows=1 width=47) (actual time=0.004..0.004 rows=1 loops=6)

  • Index Cond: (pessoa = ra.professor)
14. 0.036 0.036 ↑ 1.0 1 6

Index Only Scan using pessoa_pkey on pessoa (cost=0.41..2.74 rows=1 width=4) (actual time=0.005..0.006 rows=1 loops=6)

  • Index Cond: (codigo = funcionario.pessoa)
  • Heap Fetches: 6
15. 0.072 0.072 ↑ 1.0 1 6

Index Only Scan using ch_formacaoacademica_pessoa on formacaoacademica (cost=0.29..0.31 rows=1 width=4) (actual time=0.011..0.012 rows=1 loops=6)

  • Index Cond: (pessoa = pessoa.codigo)
  • Heap Fetches: 6
16. 1.218 1.218 ↓ 57.0 57 6

Index Scan using matriculaperiodoturmadisciplina_turma_disciplina_matricula on matriculaperiodoturmadisciplina (cost=0.42..8.20 rows=1 width=12) (actual time=0.016..0.203 rows=57 loops=6)

  • Index Cond: ((turma = ra.turma) AND (disciplina = 59))
17. 1.705 1.705 ↓ 0.0 0 341

Index Scan using matriculaperiodo_pkey on matriculaperiodo (cost=0.29..6.76 rows=1 width=14) (actual time=0.005..0.005 rows=0 loops=341)

  • Index Cond: (codigo = matriculaperiodoturmadisciplina.matriculaperiodo)
  • Filter: ((matricula)::text = '152ENG00018'::text)
  • Rows Removed by Filter: 1
18. 0.000 0.000 ↓ 0.0 0

Index Scan using matricula_pkey on matricula (cost=0.29..8.30 rows=1 width=9) (never executed)

  • Index Cond: ((matricula)::text = '152ENG00018'::text)
  • Filter: (unidadeensino = 29)
19. 0.000 0.000 ↓ 0.0 0

Index Only Scan using frequenciaaula_pkey on frequenciaaula fa (cost=0.56..4.83 rows=1 width=14) (never executed)

  • Index Cond: ((matricula = '152ENG00018'::text) AND (registroaula = ra.codigo))
  • Heap Fetches: 0