QUERY PLAN
Group (cost=4503.62..4506.50 rows=174 width=4)
Group Key: out_device
-> Sort (cost=4503.62..4505.06 rows=576 width=4)
Sort Key: out_device
-> Seq Scan on tbl_punch (cost=0.00..4477.21 rows=576 width=4)
Filter: ((out_device IS NOT NULL) AND (user_id = 1000))