QUERY PLAN
Limit (cost=33.83..33.85 rows=10 width=463)
-> Sort (cost=33.83..34.02 rows=77 width=463)
Sort Key: s.created_at DESC
-> HashAggregate (cost=30.82..32.16 rows=77 width=463)
Group Key: s.id
-> Hash Right Join (cost=10.20..28.71 rows=842 width=443)
Hash Cond: (turs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.73 rows=473 width=4)
-> Hash (cost=8.48..8.48 rows=137 width=443)
-> Hash Right Join (cost=5.73..8.48 rows=137 width=443)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.37 rows=137 width=4)
-> Hash (cost=4.77..4.77 rows=77 width=443)
-> Seq Scan on tbl_task_groups s (cost=0.00..4.77 rows=77 width=443)