explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wFODM

Settings
# exclusive inclusive rows x rows loops node
1. 0.449 293.767 ↑ 58.2 10 1

Unique (cost=10,642.00..10,655.09 rows=582 width=69) (actual time=293.044..293.767 rows=10 loops=1)

2. 1.302 293.318 ↑ 1.8 315 1

Sort (cost=10,642.00..10,643.45 rows=582 width=69) (actual time=293.039..293.318 rows=315 loops=1)

  • Sort Key: horarioturma.codigo, t.codigo, t.subturma, t.tiposubturma, t.turmaagrupada, horarioturmadiaitem.disciplina, horarioturma.anovigente, horarioturma.semestrevigente
  • Sort Method: quicksort Memory: 69kB
3. 8.531 292.016 ↑ 1.8 315 1

Hash Join (cost=7,102.11..10,615.27 rows=582 width=69) (actual time=183.583..292.016 rows=315 loops=1)

  • Hash Cond: (horarioturma.turma = t.codigo)
  • Join Filter: ((t.semestral AND ((horarioturma.anovigente)::text = '2020'::text) AND ((horarioturma.semestrevigente)::text = '2'::text)) OR (t.anual AND ((horarioturma.anovigente)::text = '2020'::text)) OR ((NOT t.semestral) AND (NOT t.anual) AND (horarioturmadiaitem.data >= (CURRENT_DATE - '1 year'::interval))))
  • Rows Removed by Join Filter: 6,175
4. 14.034 266.799 ↓ 1.1 6,490 1

Hash Join (cost=6,850.91..10,348.25 rows=6,028 width=25) (actual time=27.043..266.799 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.horarioturma = horarioturma.codigo)
5. 125.632 245.954 ↓ 1.1 6,490 1

Hash Join (cost=6,759.09..10,240.58 rows=6,028 width=16) (actual time=20.204..245.954 rows=6,490 loops=1)

  • Hash Cond: (horarioturmadia.codigo = horarioturmadiaitem.horarioturmadia)
6. 100.444 100.444 ↑ 1.0 102,812 1

Seq Scan on horarioturmadia (cost=0.00..2,650.12 rows=102,812 width=8) (actual time=0.009..100.444 rows=102,812 loops=1)

7. 8.030 19.878 ↓ 1.1 6,490 1

Hash (cost=6,683.74..6,683.74 rows=6,028 width=16) (actual time=19.876..19.878 rows=6,490 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 369kB
8. 11.238 11.848 ↓ 1.1 6,490 1

Bitmap Heap Scan on horarioturmadiaitem (cost=115.14..6,683.74 rows=6,028 width=16) (actual time=0.827..11.848 rows=6,490 loops=1)

  • Recheck Cond: (professor = 9,959)
  • Heap Blocks: exact=1,217
9. 0.610 0.610 ↓ 1.1 6,490 1

Bitmap Index Scan on idx_horturdiaitem_professor (cost=0.00..113.63 rows=6,028 width=0) (actual time=0.610..0.610 rows=6,490 loops=1)

  • Index Cond: (professor = 9,959)
10. 3.362 6.811 ↑ 1.0 2,970 1

Hash (cost=54.70..54.70 rows=2,970 width=13) (actual time=6.810..6.811 rows=2,970 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 171kB
11. 3.449 3.449 ↑ 1.0 2,970 1

Seq Scan on horarioturma (cost=0.00..54.70 rows=2,970 width=13) (actual time=0.021..3.449 rows=2,970 loops=1)

12. 7.005 16.686 ↓ 1.3 5,856 1

Hash (cost=194.56..194.56 rows=4,531 width=14) (actual time=16.685..16.686 rows=5,856 loops=1)

  • Buckets: 8,192 Batches: 1 Memory Usage: 326kB
13. 9.681 9.681 ↓ 1.3 5,856 1

Seq Scan on turma t (cost=0.00..194.56 rows=4,531 width=14) (actual time=0.016..9.681 rows=5,856 loops=1)

  • Filter: (semestral OR anual OR ((NOT semestral) AND (NOT anual)))
Planning time : 2.072 ms
Execution time : 293.919 ms