QUERY PLAN
Sort (cost=2362.46..2362.98 rows=205 width=4)
Sort Key: in_device
-> HashAggregate (cost=2352.54..2354.59 rows=205 width=4)
Group Key: in_device
-> Seq Scan on tbl_punch (cost=0.00..2351.20 rows=537 width=4)
Filter: ((in_device IS NOT NULL) AND (user_id = 1011))