QUERY PLAN
Group (cost=2494.13..2496.84 rows=188 width=4)
Group Key: in_device
-> Sort (cost=2494.13..2495.49 rows=543 width=4)
Sort Key: in_device
-> Seq Scan on tbl_punch (cost=0.00..2469.46 rows=543 width=4)
Filter: ((in_device IS NOT NULL) AND (user_id = 1000))