QUERY PLAN
Group (cost=2374.14..2376.69 rows=203 width=4)
Group Key: in_device
-> Sort (cost=2374.14..2375.41 rows=510 width=4)
Sort Key: in_device
-> Seq Scan on tbl_punch (cost=0.00..2351.20 rows=510 width=4)
Filter: ((in_device IS NOT NULL) AND (user_id = 1000))