QUERY PLAN
GroupAggregate (cost=125.08..125.10 rows=1 width=12)
Group Key: case_id
-> Sort (cost=125.08..125.09 rows=1 width=4)
Sort Key: case_id
-> Seq Scan on tbl_pre_sales (cost=0.00..125.07 rows=1 width=4)
Filter: ((created_by = 1000) AND (case_id = ANY ('{8267,8264,8268,8266,8265,5051,8263,8262,8260,8246,8256,8257,8249,8215,8252,8259,8250,8258,8247,8255}'::integer[])))