QUERY PLAN
HashAggregate (cost=9.86..9.95 rows=9 width=4)
Group Key: u.department_id
-> Hash Right Join (cost=1.64..9.80 rows=25 width=4)
Hash Cond: (u.id = psrr.user_id)
-> Seq Scan on tbl_users u (cost=0.00..7.39 rows=139 width=8)
-> Hash (cost=1.32..1.32 rows=25 width=4)
-> Seq Scan on tbl_punch_strategy_resource_rels psrr (cost=0.00..1.32 rows=25 width=4)
Filter: ((user_id IS NOT NULL) AND (punch_strategy_id <> 35))