explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aiLa

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 0.480 ↓ 0.0 0 1

Sort (cost=189.58..190.06 rows=191 width=532) (actual time=0.480..0.480 rows=0 loops=1)

  • Sort Key: ed.datetime
  • Sort Method: quicksort Memory: 25kB
2. 0.000 0.477 ↓ 0.0 0 1

Hash Left Join (cost=66.73..182.34 rows=191 width=532) (actual time=0.477..0.477 rows=0 loops=1)

  • Hash Cond: (ed.class_id = cd.class_id)
3. 0.000 0.477 ↓ 0.0 0 1

Hash Anti Join (cost=19.68..131.71 rows=191 width=30) (actual time=0.477..0.477 rows=0 loops=1)

  • Hash Cond: (core.get_notification_idempotent_id('class'::text, ed.class_id, (ed.datetime)::date) = (np.notification_idempotent_id)::text)
4. 0.477 0.477 ↓ 0.0 0 1

Seq Scan on effective_datetimes ed (cost=0.00..82.38 rows=382 width=30) (actual time=0.477..0.477 rows=0 loops=1)

  • Filter: ((NOT cancelled) AND (datetime >= now()) AND (((datetime <= (now() + '03:00:00'::interval)) AND (channel_type = 'classroom'::classes.class_channel_type)) OR ((datetime <= (now() + '00:10:00'::interval)) AND (channel_type <> 'classroom'::classes.class_channel_type))))
  • Rows Removed by Filter: 1,871
5. 0.000 0.000 ↓ 0.0 0

Hash (cost=14.30..14.30 rows=430 width=118) (never executed)

6. 0.000 0.000 ↓ 0.0 0

Seq Scan on notification_processed_new np (cost=0.00..14.30 rows=430 width=118) (never executed)

7. 0.000 0.000 ↓ 0.0 0

Hash (cost=45.42..45.42 rows=131 width=498) (never executed)

8. 0.000 0.000 ↓ 0.0 0

Subquery Scan on cd (cost=37.13..45.42 rows=131 width=498) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=37.13..44.11 rows=131 width=3,261) (never executed)

  • Hash Cond: (cd_1.class_id = num_students.class_id)
10.          

CTE class_data

11. 0.000 0.000 ↓ 0.0 0

Seq Scan on class (cost=0.00..7.31 rows=131 width=481) (never executed)

12. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=11.52..16.69 rows=131 width=498) (never executed)

  • Hash Cond: (cd_1.image = i.image_id)
13. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=4.38..9.19 rows=131 width=454) (never executed)

  • Hash Cond: (cd_1.class_id = ctf.class_id)
14. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=2.44..6.36 rows=131 width=454) (never executed)

  • Hash Cond: (cd_1.class_id = ctl.class_id)
15. 0.000 0.000 ↓ 0.0 0

CTE Scan on class_data cd_1 (cost=0.00..2.62 rows=131 width=462) (never executed)

16. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.84..1.84 rows=48 width=8) (never executed)

17. 0.000 0.000 ↓ 0.0 0

Seq Scan on class_teacher ctl (cost=0.00..1.84 rows=48 width=8) (never executed)

  • Filter: (role = 'leader'::classes.teacher_role)
18. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.84..1.84 rows=8 width=8) (never executed)

19. 0.000 0.000 ↓ 0.0 0

Seq Scan on class_teacher ctf (cost=0.00..1.84 rows=8 width=8) (never executed)

  • Filter: (role = 'follower'::classes.teacher_role)
20. 0.000 0.000 ↓ 0.0 0

Hash (cost=4.84..4.84 rows=184 width=52) (never executed)

21. 0.000 0.000 ↓ 0.0 0

Seq Scan on image i (cost=0.00..4.84 rows=184 width=52) (never executed)

22. 0.000 0.000 ↓ 0.0 0

Hash (cost=16.54..16.54 rows=141 width=4) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Subquery Scan on num_students (cost=13.72..16.54 rows=141 width=4) (never executed)

24. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=13.72..15.13 rows=141 width=8) (never executed)

  • Group Key: class_couple.class_id, ((count(class_couple.leader_id))::smallint), ((count(class_couple.follower_id))::smallint)
25. 0.000 0.000 ↓ 0.0 0

Append (cost=1.68..12.67 rows=141 width=8) (never executed)

26. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=1.68..2.27 rows=39 width=8) (never executed)

  • Group Key: class_couple.class_id
27. 0.000 0.000 ↓ 0.0 0

Seq Scan on class_couple (cost=0.00..1.39 rows=39 width=12) (never executed)

28. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=7.01..8.29 rows=102 width=8) (never executed)

  • Group Key: class_student.class_id
29. 0.000 0.000 ↓ 0.0 0

Seq Scan on class_student (cost=0.00..5.34 rows=334 width=8) (never executed)

Planning time : 0.916 ms
Execution time : 0.587 ms