QUERY PLAN
HashAggregate (cost=37.46..37.70 rows=24 width=35)
Group Key: s.id
-> Hash Right Join (cost=24.17..37.12 rows=133 width=35)
Hash Cond: (thrs.task_group_id = s.id)
Filter: ((thrs.user_id = 1000) OR (turs.user_id = 1000))
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..5.70 rows=370 width=8)
-> Hash (cost=22.63..22.63 rows=123 width=39)
-> Hash Right Join (cost=13.48..22.63 rows=123 width=39)
Hash Cond: (turs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.83 rows=483 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)