QUERY PLAN
Limit (cost=17.41..17.42 rows=1 width=463)
-> Sort (cost=17.41..17.42 rows=1 width=463)
Sort Key: s.created_at DESC
-> HashAggregate (cost=17.38..17.40 rows=1 width=463)
Group Key: s.id
-> Hash Right Join (cost=7.75..17.36 rows=11 width=443)
Hash Cond: (turs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.33 rows=433 width=4)
-> Hash (cost=7.73..7.73 rows=2 width=443)
-> Hash Right Join (cost=4.98..7.73 rows=2 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.96..4.96 rows=1 width=443)
-> Seq Scan on tbl_task_groups s (cost=0.00..4.96 rows=1 width=443)
Filter: (project_id = 3810)