QUERY PLAN
Limit (cost=157.58..157.60 rows=10 width=252)
-> Sort (cost=157.55..157.62 rows=27 width=252)
Sort Key: s.target_completed_at, s.updated_at DESC
-> Group (cost=156.71..156.91 rows=27 width=252)
Group Key: s.id, u.id
-> Sort (cost=156.71..156.78 rows=27 width=252)
Sort Key: s.id, u.id
-> Hash Left Join (cost=9.17..156.07 rows=27 width=252)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..146.82 rows=27 width=248)
Filter: ((parent_id IS NULL) AND (status = '0'::smallint))
-> 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)