QUERY PLAN
GroupAggregate (cost=106.09..106.16 rows=4 width=12)
Group Key: case_id
-> Sort (cost=106.09..106.10 rows=4 width=4)
Sort Key: case_id
-> Seq Scan on tbl_pre_sales (cost=0.00..106.05 rows=4 width=4)
Filter: ((created_by = 1017) AND (case_id = ANY ('{8279,8273,8272,8271,8267,8264,8231,8243,8176,8179}'::integer[])))