QUERY PLAN
HashAggregate (cost=27.91..28.06 rows=15 width=37)
Group Key: s.id
-> Hash Right Join (cost=15.48..27.65 rows=102 width=37)
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=14.41..14.41 rows=85 width=41)
-> Hash Right Join (cost=5.25..14.41 rows=85 width=41)
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=5.06..5.06 rows=15 width=37)
-> Seq Scan on tbl_task_groups s (cost=0.00..5.06 rows=15 width=37)
Filter: (status = 0)