QUERY PLAN
GroupAggregate (cost=1065.34..1065.64 rows=11 width=20)
Group Key: client_id
-> Sort (cost=1065.34..1065.36 rows=11 width=24)
Sort Key: client_id
-> Bitmap Heap Scan on tbl_work_logs (cost=48.40..1065.15 rows=11 width=24)
Recheck Cond: ((client_id IS NOT NULL) AND (client_id = ANY ('{2007,2505,427,498,518,2821,3331,31,2153,2546}'::integer[])))
Filter: ((NOT is_draft) AND (location_in_id IS NOT NULL) AND (location_out_id IS NOT NULL) AND (scenario_id = 1))
-> Bitmap Index Scan on tbl_work_logs_client_id_idx (cost=0.00..48.40 rows=552 width=0)
Index Cond: ((client_id IS NOT NULL) AND (client_id = ANY ('{2007,2505,427,498,518,2821,3331,31,2153,2546}'::integer[])))