QUERY PLAN
HashAggregate (cost=32.74..32.98 rows=24 width=35)
Group Key: s.id
-> Hash Right Join (cost=18.55..32.57 rows=69 width=35)
Hash Cond: (turs.task_group_id = s.id)
Filter: ((thrs.user_id = 1000) OR (turs.user_id = 1000))
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.83 rows=483 width=8)
-> Hash (cost=17.93..17.93 rows=49 width=39)
-> Hash Right Join (cost=13.48..17.93 rows=49 width=39)
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=13.18..13.18 rows=24 width=35)
-> Seq Scan on tbl_task_groups s (cost=0.00..13.18 rows=24 width=35)
Filter: (status = 0)