explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MejL : lesson exists

Settings
# exclusive inclusive rows x rows loops node
1. 0.037 8,031.513 ↑ 1.0 25 1

Limit (cost=2,004.35..21,052.88 rows=25 width=4) (actual time=535.071..8,031.513 rows=25 loops=1)

  • Output: fgos_disciplinegroup.id
  • Buffers: shared hit=2064 read=1892
2. 16.296 8,031.476 ↑ 3.9 25 1

Bitmap Heap Scan on public.fgos_disciplinegroup (cost=2,004.35..75,912.65 rows=97 width=4) (actual time=535.069..8,031.476 rows=25 loops=1)

  • Output: fgos_disciplinegroup.id
  • Recheck Cond: ((fgos_disciplinegroup.school_id = 103) AND (fgos_disciplinegroup.period_id = 12))
  • Filter: (alternatives: SubPlan 1 or hashed SubPlan 2)
  • Rows Removed by Filter: 29
  • Heap Blocks: exact=11
  • Buffers: shared hit=2064 read=1892
3. 0.008 32.900 ↓ 0.0 0 1

BitmapAnd (cost=2,004.35..2,004.35 rows=194 width=0) (actual time=32.900..32.900 rows=0 loops=1)

  • Buffers: shared hit=301 read=6
4. 29.190 29.190 ↑ 1.7 1,276 1

Bitmap Index Scan on fgos_disciplinegroup_school_id (cost=0.00..44.88 rows=2,194 width=0) (actual time=29.190..29.190 rows=1,276 loops=1)

  • Index Cond: (fgos_disciplinegroup.school_id = 103)
  • Buffers: shared hit=1 read=6
5. 3.702 3.702 ↓ 1.0 108,447 1

Bitmap Index Scan on fgos_disciplinegroup_period_id (cost=0.00..1,959.16 rows=105,965 width=0) (actual time=3.702..3.702 rows=108,447 loops=1)

  • Index Cond: (fgos_disciplinegroup.period_id = 12)
  • Buffers: shared hit=300
6.          

SubPlan (for Bitmap Heap Scan)

7. 7,982.280 7,982.280 ↓ 0.0 0 54

Index Scan using schedule_lesson_discipline_group_id on public.schedule_lesson u0 (cost=0.44..377.32 rows=1 width=0) (actual time=147.820..147.820 rows=0 loops=54)

  • Index Cond: (u0.discipline_group_id = fgos_disciplinegroup.id)
  • Filter: (u0.date = '2019-05-10'::date)
  • Rows Removed by Filter: 74
  • Buffers: shared hit=1762 read=1876
8. 0.000 0.000 ↓ 0.0 0

Index Scan using schedule_lesson_date on public.schedule_lesson u0_1 (cost=0.44..70,670.83 rows=20,885 width=4) (never executed)

  • Output: u0_1.discipline_group_id
  • Index Cond: (u0_1.date = '2019-05-10'::date)