explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Ftfe

Settings
# exclusive inclusive rows x rows loops node
1. 0.220 1,931.592 ↓ 99.0 99 1

Sort (cost=4,786.81..4,786.82 rows=1 width=160) (actual time=1,931.588..1,931.592 rows=99 loops=1)

  • Sort Key: ed_matricula_turma.ordem, ed_etapa.nome
  • Sort Method: quicksort Memory: 32kB
2. 1.016 1,931.372 ↓ 99.0 99 1

Nested Loop (cost=810.34..4,786.80 rows=1 width=160) (actual time=39.037..1,931.372 rows=99 loops=1)

3. 0.489 1,928.772 ↓ 99.0 99 1

Nested Loop (cost=810.06..4,774.04 rows=1 width=138) (actual time=39.006..1,928.772 rows=99 loops=1)

4. 0.072 39.957 ↓ 99.0 99 1

Nested Loop (cost=809.64..2,443.65 rows=1 width=146) (actual time=37.074..39.957 rows=99 loops=1)

5. 0.012 0.182 ↑ 1.0 1 1

Nested Loop (cost=0.86..75.14 rows=1 width=12) (actual time=0.164..0.182 rows=1 loops=1)

6. 0.021 0.114 ↓ 1.3 8 1

Nested Loop (cost=0.57..72.92 rows=6 width=12) (actual time=0.062..0.114 rows=8 loops=1)

7. 0.037 0.037 ↓ 1.3 8 1

Index Scan using un_ed_grupo_falta_1 on ed_grupo_falta (cost=0.29..23.04 rows=6 width=8) (actual time=0.032..0.037 rows=8 loops=1)

  • Index Cond: (ed_turma = 4290)
8. 0.056 0.056 ↑ 1.0 1 8

Index Only Scan using un_ed_grupo_falta_disciplina_1 on ed_grupo_falta_disciplina (cost=0.29..8.30 rows=1 width=8) (actual time=0.006..0.007 rows=1 loops=8)

  • Index Cond: (ed_grupo_falta = ed_grupo_falta.ed_grupo_falta)
  • Heap Fetches: 8
9. 0.056 0.056 ↓ 0.0 0 8

Index Scan using pk_ed_disciplina_turma on ed_disciplina_turma (cost=0.29..0.36 rows=1 width=8) (actual time=0.007..0.007 rows=0 loops=8)

  • Index Cond: (ed_disciplina_turma = ed_grupo_falta_disciplina.ed_disciplina_turma)
  • Filter: ((ed_turma = 4290) AND (ed_disciplina = 51))
  • Rows Removed by Filter: 1
10. 0.268 39.703 ↓ 1.1 99 1

Nested Loop (cost=808.79..2,367.60 rows=91 width=146) (actual time=36.909..39.703 rows=99 loops=1)

11. 0.054 38.940 ↓ 1.1 99 1

Nested Loop (cost=808.50..2,335.85 rows=91 width=142) (actual time=36.889..38.940 rows=99 loops=1)

12. 0.029 0.029 ↑ 1.0 1 1

Index Scan using pk_ed_turma on ed_turma (cost=0.28..8.30 rows=1 width=8) (actual time=0.028..0.029 rows=1 loops=1)

  • Index Cond: (ed_turma = 4290)
13. 0.187 38.857 ↓ 1.1 99 1

Hash Join (cost=808.22..2,326.64 rows=91 width=138) (actual time=36.859..38.857 rows=99 loops=1)

  • Hash Cond: (ed_etapa_periodo.ed_etapa = ed_etapa.ed_etapa)
14. 0.462 38.600 ↓ 1.1 99 1

Nested Loop (cost=806.77..2,324.89 rows=91 width=24) (actual time=36.761..38.600 rows=99 loops=1)

15. 0.157 37.346 ↓ 1.1 99 1

Hash Join (cost=806.49..2,297.28 rows=91 width=20) (actual time=36.736..37.346 rows=99 loops=1)

  • Hash Cond: (ed_matricula_etapa.ed_matricula_status = ed_matricula_status.id)
16. 12.907 37.158 ↓ 1.1 99 1

Hash Join (cost=805.33..2,295.74 rows=91 width=24) (actual time=36.680..37.158 rows=99 loops=1)

  • Hash Cond: (ed_matricula_etapa.ed_matricula_turma = ed_matricula_turma.id)
17. 17.710 17.710 ↑ 1.0 73,115 1

Seq Scan on ed_matricula_etapa (cost=0.00..1,212.00 rows=74,000 width=12) (actual time=0.020..17.710 rows=73,115 loops=1)

18. 0.018 6.541 ↑ 1.0 33 1

Hash (cost=804.92..804.92 rows=33 width=20) (actual time=6.541..6.541 rows=33 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
19. 0.032 6.523 ↑ 1.0 33 1

Nested Loop (cost=0.29..804.92 rows=33 width=20) (actual time=6.309..6.523 rows=33 loops=1)

20. 6.359 6.359 ↑ 1.0 33 1

Seq Scan on ed_matricula_turma (cost=0.00..554.85 rows=33 width=16) (actual time=6.277..6.359 rows=33 loops=1)

  • Filter: (ed_turma = 4290)
  • Rows Removed by Filter: 26918
21. 0.132 0.132 ↑ 1.0 1 33

Index Scan using pk_ed_matricula_aluno on ed_matricula_aluno (cost=0.29..7.58 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=33)

  • Index Cond: (ed_matricula_aluno = ed_matricula_turma.ed_matricula_aluno)
22. 0.015 0.031 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=4) (actual time=0.031..0.031 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
23. 0.016 0.016 ↑ 1.0 7 1

Seq Scan on ed_matricula_status (cost=0.00..1.07 rows=7 width=4) (actual time=0.013..0.016 rows=7 loops=1)

24. 0.792 0.792 ↑ 1.0 1 99

Index Scan using pk_ed_etapa_periodo on ed_etapa_periodo (cost=0.28..0.30 rows=1 width=8) (actual time=0.008..0.008 rows=1 loops=99)

  • Index Cond: (ed_etapa_periodo = ed_matricula_etapa.ed_etapa_periodo)
25. 0.027 0.070 ↑ 1.0 20 1

Hash (cost=1.20..1.20 rows=20 width=122) (actual time=0.070..0.070 rows=20 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
26. 0.043 0.043 ↑ 1.0 20 1

Seq Scan on ed_etapa (cost=0.00..1.20 rows=20 width=122) (actual time=0.036..0.043 rows=20 loops=1)

27. 0.495 0.495 ↑ 1.0 1 99

Index Scan using pk_ed_aluno on ed_aluno (cost=0.29..0.35 rows=1 width=12) (actual time=0.005..0.005 rows=1 loops=99)

  • Index Cond: (ed_aluno = ed_matricula_aluno.ed_aluno)
28. 1,888.326 1,888.326 ↑ 1.0 1 99

Index Only Scan using pk_gg_geral on gg_geral (cost=0.42..2,330.39 rows=1 width=8) (actual time=11.958..19.074 rows=1 loops=99)

  • Index Cond: (codigo_g = (ed_aluno.codigo_g)::text)
  • Heap Fetches: 99
29. 0.693 0.693 ↑ 1.0 1 99

Index Only Scan using pk_ed_periodo_letivo on ed_periodo_letivo (cost=0.27..4.29 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=99)

  • Index Cond: (ed_periodo_letivo = ed_turma.ed_periodo_letivo)
  • Heap Fetches: 0
30.          

SubPlan (forNested Loop)

31. 0.891 0.891 ↑ 1.0 1 99

Index Scan using un_ed_falta_1 on ed_falta (cost=0.42..8.44 rows=1 width=1) (actual time=0.008..0.009 rows=1 loops=99)

  • Index Cond: ((ed_matricula_aluno = ed_matricula_aluno.ed_matricula_aluno) AND (ed_etapa_periodo = ed_etapa_periodo.ed_etapa_periodo) AND (ed_grupo_falta = ed_grupo_falta.ed_grupo_falta))