QUERY PLAN
Aggregate (cost=250.92..250.93 rows=1 width=8)
-> Sort (cost=233.37..236.29 rows=1170 width=228)
Sort Key: s.updated_at DESC
-> HashAggregate (cost=162.04..173.74 rows=1170 width=228)
Group Key: s.id, u.id
-> Hash Left Join (cost=9.17..156.19 rows=1170 width=16)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..143.86 rows=1170 width=24)
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)