QUERY PLAN
Limit (cost=41.47..41.49 rows=10 width=396)
-> Sort (cost=41.44..41.67 rows=91 width=396)
Sort Key: s.created_at DESC
-> HashAggregate (cost=37.43..39.02 rows=91 width=396)
Group Key: s.id
-> Hash Right Join (cost=13.92..34.81 rows=1048 width=372)
Hash Cond: (turs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.94 rows=494 width=4)
-> Hash (cost=11.51..11.51 rows=193 width=372)
-> Hash Right Join (cost=7.05..11.51 rows=193 width=372)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..3.93 rows=193 width=8)
-> Hash (cost=5.91..5.91 rows=91 width=372)
-> Seq Scan on tbl_task_groups s (cost=0.00..5.91 rows=91 width=372)