explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aiIi

Settings
# exclusive inclusive rows x rows loops node
1. 7.588 271,955.105 ↓ 4.0 666 1

HashAggregate (cost=135,606.68..135,608.35 rows=167 width=38) (actual time=271,954.907..271,955.105 rows=666 loops=1)

  • Group Key: matriculaperiodo.codigo, matriculaperiodo.matricula, historico.matricula, historico.matrizcurricular, matriculaperiodo.gradecurricular
2. 39.246 271,947.517 ↓ 53.7 8,971 1

Nested Loop (cost=5,687.11..135,604.59 rows=167 width=38) (actual time=23,549.767..271,947.517 rows=8,971 loops=1)

3. 82.367 2,013.691 ↓ 25.1 21,102 1

Nested Loop Anti Join (cost=5,686.68..12,995.09 rows=841 width=25) (actual time=112.963..2,013.691 rows=21,102 loops=1)

4. 377.847 532.432 ↓ 98.4 127,172 1

Hash Join (cost=5,686.25..12,384.49 rows=1,292 width=25) (actual time=110.723..532.432 rows=127,172 loops=1)

  • Hash Cond: (((matriculaperiodo.matricula)::text = (matricula.matricula)::text) AND (matriculaperiodo.gradecurricular = matricula.gradecurricularatual))
5. 43.902 43.902 ↓ 1.0 127,448 1

Seq Scan on matriculaperiodo (cost=0.00..3,501.52 rows=127,352 width=21) (actual time=0.002..43.902 rows=127,448 loops=1)

6. 39.816 110.683 ↓ 1.0 126,223 1

Hash (cost=3,794.30..3,794.30 rows=126,130 width=17) (actual time=110.683..110.683 rows=126,223 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 6430kB
7. 70.867 70.867 ↓ 1.0 126,223 1

Seq Scan on matricula (cost=0.00..3,794.30 rows=126,130 width=17) (actual time=0.004..70.867 rows=126,223 loops=1)

8. 1,398.892 1,398.892 ↑ 52.0 1 127,172

Index Only Scan using ch_contareceber_matriculaaluno on contareceber (cost=0.43..1.83 rows=52 width=13) (actual time=0.011..0.011 rows=1 loops=127,172)

  • Index Cond: (matriculaaluno = (matriculaperiodo.matricula)::text)
  • Heap Fetches: 2377
9. 269,894.580 269,894.580 ↓ 0.0 0 21,102

Index Scan using ch_historico_gc on historico (cost=0.43..145.78 rows=1 width=21) (actual time=12.481..12.790 rows=0 loops=21,102)

  • Index Cond: (matrizcurricular = matriculaperiodo.gradecurricular)
  • Filter: (((matriculaperiodo.matricula)::text <> (matricula)::text) AND (matriculaperiodo.codigo = matriculaperiodo))
  • Rows Removed by Filter: 24238