QUERY PLAN
HashAggregate (cost=21.25..21.36 rows=11 width=38)
Group Key: s.id
-> Hash Right Join (cost=8.74..21.15 rows=42 width=38)
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.78 rows=478 width=8)
-> Hash (cost=8.43..8.43 rows=25 width=42)
-> Hash Right Join (cost=5.14..8.43 rows=25 width=42)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.80 rows=180 width=8)
-> Hash (cost=5.00..5.00 rows=11 width=38)
-> Seq Scan on tbl_task_groups s (cost=0.00..5.00 rows=11 width=38)
Filter: (status = 0)