QUERY PLAN
Limit (cost=45.41..45.44 rows=10 width=145)
-> Sort (cost=45.41..45.46 rows=19 width=145)
Sort Key: s.target_completed_at, s.updated_at DESC
-> Group (cost=44.87..45.01 rows=19 width=145)
Group Key: s.id, u.id
-> Sort (cost=44.87..44.92 rows=19 width=145)
Sort Key: s.id, u.id
-> Hash Left Join (cost=9.13..44.46 rows=19 width=145)
Hash Cond: (s.head_of = u.id)
-> Seq Scan on tbl_tasks s (cost=0.00..35.29 rows=19 width=141)
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)