QUERY PLAN
Limit (cost=199.03..199.05 rows=10 width=252)
-> Sort (cost=199.03..201.95 rows=1170 width=252)
Sort Key: s.status, s.target_completed_at, s.updated_at DESC
-> HashAggregate (cost=162.04..173.74 rows=1170 width=252)
Group Key: s.id, u.id
-> Hash Left Join (cost=9.17..156.19 rows=1170 width=252)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..143.86 rows=1170 width=248)
Filter: (parent_id IS NULL)
-> Hash (cost=7.41..7.41 rows=141 width=4)
-> Seq Scan on tbl_users u (cost=0.00..7.41 rows=141 width=4)