QUERY PLAN
Aggregate (cost=520.08..520.09 rows=1 width=8)
-> Group (cost=520.03..520.04 rows=3 width=4)
Group Key: c.id
-> Sort (cost=520.03..520.03 rows=3 width=4)
Sort Key: c.id
-> Hash Join (cost=299.80..520.00 rows=3 width=4)
Hash Cond: (ca.case_id = c.id)
-> Seq Scan on tbl_case_assignments ca (cost=0.00..217.92 rows=867 width=4)
Filter: ((assignment_status = ANY ('{1,2}'::integer[])) AND (engineer_id = 1015))
-> Hash (cost=299.44..299.44 rows=29 width=8)
-> Seq Scan on tbl_cases c (cost=0.00..299.44 rows=29 width=8)
Filter: (case_status = ANY ('{1,2,3}'::integer[]))