explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zLTQ : Optimization for: plan #u6lA

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Limit (cost=12.84..12.84 rows=1 width=77) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Sort (cost=12.84..12.84 rows=1 width=77) (actual rows= loops=)

  • Sort Key: plan_lessons.started_at DESC
3. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.55..12.83 rows=1 width=77) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9.42..12.57 rows=1 width=20) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Hash Join (cost=9.27..10.74 rows=1 width=12) (actual rows= loops=)

  • Hash Cond: (plan_lessons.plan_id = plans.id)
6. 0.000 0.000 ↓ 0.0

Seq Scan on plan_lessons (cost=0.00..1.29 rows=29 width=16) (actual rows= loops=)

7. 0.000 0.000 ↓ 0.0

Hash (cost=9.26..9.26 rows=1 width=8) (actual rows= loops=)

8. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.15..9.26 rows=1 width=8) (actual rows= loops=)

  • Join Filter: (plans.classroom_id = classrooms.id)
9. 0.000 0.000 ↓ 0.0

Index Scan using index_classrooms_on_uuid on classrooms (cost=0.15..8.17 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (uuid = '290c67aa-b245-4c73-88e0-2ab5a0cf34c0'::uuid)
10. 0.000 0.000 ↓ 0.0

Seq Scan on plans (cost=0.00..1.04 rows=4 width=12) (actual rows= loops=)

11. 0.000 0.000 ↓ 0.0

Index Only Scan using lessons_pkey on lessons (cost=0.15..1.82 rows=1 width=8) (actual rows= loops=)

  • Index Cond: (id = plan_lessons.lesson_id)
12. 0.000 0.000 ↓ 0.0

Index Scan using index_assignments_on_lesson_id on assignments (cost=0.13..0.22 rows=4 width=69) (actual rows= loops=)

  • Index Cond: (lesson_id = lessons.id)