QUERY PLAN
Group (cost=19.59..19.65 rows=8 width=39)
Group Key: s.id
-> Sort (cost=19.59..19.62 rows=12 width=39)
Sort Key: s.id
-> Hash Right Join (cost=7.99..19.37 rows=12 width=39)
Hash Cond: (turs.task_group_id = s.id)
Filter: ((thrs.user_id = 1001) OR (turs.user_id = 1001))
-> Seq Scan on tbl_task_group_user_relationships turs (cost=0.00..7.73 rows=473 width=8)
-> Hash (cost=7.81..7.81 rows=14 width=43)
-> Hash Right Join (cost=5.06..7.81 rows=14 width=43)
Hash Cond: (thrs.task_group_id = s.id)
-> Seq Scan on tbl_task_group_head_of_relationships thrs (cost=0.00..2.37 rows=137 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)