explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6SyD

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 0.567 ↓ 20.0 20 1

Unique (cost=1,108.22..1,108.25 rows=1 width=154) (actual time=0.546..0.567 rows=20 loops=1)

2. 0.033 0.547 ↓ 20.0 20 1

Sort (cost=1,108.22..1,108.22 rows=1 width=154) (actual time=0.544..0.547 rows=20 loops=1)

  • Sort Key: lessons.id, lessons.subject_id, lessons.remote_key, lessons.title, lessons.start_time, lessons.date, lessons.created_at, lessons.updated_at, lessons.active
  • Sort Method: quicksort Memory: 28kB
3. 0.051 0.514 ↓ 20.0 20 1

Nested Loop (cost=5.58..1,108.21 rows=1 width=154) (actual time=0.171..0.514 rows=20 loops=1)

4. 0.040 0.063 ↓ 1.1 100 1

Bitmap Heap Scan on lesson_teachers (cost=5.02..292.96 rows=94 width=8) (actual time=0.032..0.063 rows=100 loops=1)

  • Recheck Cond: (teacher_id = '5'::bigint)
  • Heap Blocks: exact=4
5. 0.023 0.023 ↓ 1.1 100 1

Bitmap Index Scan on index_lesson_teachers_on_teacher_id (cost=0.00..5.00 rows=94 width=0) (actual time=0.023..0.023 rows=100 loops=1)

  • Index Cond: (teacher_id = '5'::bigint)
6. 0.400 0.400 ↓ 0.0 0 100

Index Scan using index_lessons_on_id_and_date on lessons (cost=0.56..8.59 rows=1 width=154) (actual time=0.004..0.004 rows=0 loops=100)

  • Index Cond: ((id = lesson_teachers.lesson_id) AND (date >= '2020-06-22'::date) AND (date <= '2020-06-30'::date))
Planning time : 1.234 ms
Execution time : 0.660 ms