QUERY PLAN
HashAggregate (cost=850.91..853.33 rows=193 width=36)
Group Key: c.project_id
-> Hash Right Join (cost=650.74..849.84 rows=215 width=36)
Hash Cond: (tbl_case_assignments.case_id = c.id)
-> HashAggregate (cost=202.64..301.69 rows=7924 width=36)
Group Key: tbl_case_assignments.case_id
-> Seq Scan on tbl_case_assignments (cost=0.00..162.76 rows=7976 width=12)
-> Hash (cost=445.41..445.41 rows=215 width=8)
-> Seq Scan on tbl_cases c (cost=0.00..445.41 rows=215 width=8)
Filter: (project_id = ANY ('{3197,3927,3915,263,2914,3837,2939,3751,3934,3883,3930,3665,3150,3910,3922,3932,3911,3933,3895,3908}'::integer[]))