QUERY PLAN
Aggregate (cost=39.49..39.50 rows=1 width=8)
-> Sort (cost=38.29..38.49 rows=80 width=218)
Sort Key: s.created_at DESC
-> HashAggregate (cost=34.96..35.76 rows=80 width=218)
Group Key: s.id
-> Hash Right Join (cost=11.34..32.27 rows=1076 width=12)
Hash Cond: (turs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.78 rows=478 width=4)
-> Hash (cost=9.09..9.09 rows=180 width=12)
-> Hash Right Join (cost=5.80..9.09 rows=180 width=12)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.80 rows=180 width=4)
-> Hash (cost=4.80..4.80 rows=80 width=16)
-> Seq Scan on tbl_task_groups s (cost=0.00..4.80 rows=80 width=16)