QUERY PLAN
Limit (cost=116.25..116.27 rows=10 width=194)
-> Sort (cost=116.17..119.19 rows=1206 width=194)
Sort Key: s.status, s.target_completed_at, s.updated_at DESC
-> HashAggregate (cost=65.99..78.05 rows=1206 width=194)
Group Key: s.id, u.id
-> Hash Left Join (cost=12.11..59.96 rows=1206 width=194)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..44.60 rows=1206 width=190)
Filter: (parent_id IS NULL)
-> Hash (cost=10.30..10.30 rows=144 width=4)
-> Index Only Scan using tbl_users_pkey on tbl_users u (cost=0.14..10.30 rows=144 width=4)