QUERY PLAN
Group (cost=4503.83..4506.73 rows=202 width=4)
Group Key: in_device
-> Sort (cost=4503.83..4505.28 rows=580 width=4)
Sort Key: in_device
-> Seq Scan on tbl_punch (cost=0.00..4477.21 rows=580 width=4)
Filter: ((in_device IS NOT NULL) AND (user_id = 5064))