QUERY PLAN
Aggregate (cost=39.12..39.13 rows=1 width=8)
-> Sort (cost=37.97..38.16 rows=77 width=218)
Sort Key: s.created_at DESC
-> HashAggregate (cost=34.78..35.55 rows=77 width=218)
Group Key: s.id
-> Hash Right Join (cost=11.18..32.08 rows=1081 width=12)
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.98..8.98 rows=176 width=12)
-> Hash Right Join (cost=5.73..8.98 rows=176 width=12)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.76 rows=176 width=4)
-> Hash (cost=4.77..4.77 rows=77 width=16)
-> Seq Scan on tbl_task_groups s (cost=0.00..4.77 rows=77 width=16)