QUERY PLAN
Aggregate (cost=45.70..45.71 rows=1 width=8)
-> Sort (cost=45.41..45.46 rows=19 width=160)
Sort Key: s.target_completed_at, s.updated_at DESC
-> Group (cost=44.87..45.01 rows=19 width=160)
Group Key: s.id, u.id
-> Sort (cost=44.87..44.92 rows=19 width=26)
Sort Key: s.id, u.id
-> Hash Left Join (cost=9.13..44.46 rows=19 width=26)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..35.29 rows=19 width=34)
Filter: (status = 0)
-> Hash (cost=7.39..7.39 rows=139 width=4)
-> Seq Scan on tbl_users u (cost=0.00..7.39 rows=139 width=4)