QUERY PLAN
Group (cost=2712.57..2715.40 rows=206 width=4)
Group Key: in_device
-> Sort (cost=2712.57..2713.98 rows=566 width=4)
Sort Key: in_device
-> Seq Scan on tbl_punch (cost=0.00..2686.69 rows=566 width=4)
Filter: ((in_device IS NOT NULL) AND (user_id = 1000))