QUERY PLAN
HashAggregate (cost=20.37..20.45 rows=8 width=39)
Group Key: s.id
-> Hash Right Join (cost=8.53..20.29 rows=32 width=39)
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.73 rows=473 width=8)
-> Hash (cost=8.31..8.31 rows=18 width=43)
-> Hash Right Join (cost=5.06..8.31 rows=18 width=43)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.76 rows=176 width=8)
-> Hash (cost=4.96..4.96 rows=8 width=39)
-> Seq Scan on tbl_task_groups s (cost=0.00..4.96 rows=8 width=39)
Filter: (status = 0)