QUERY PLAN
Group (cost=2532.99..2534.67 rows=151 width=4)
Group Key: out_device
-> Sort (cost=2532.99..2533.83 rows=336 width=4)
Sort Key: out_device
-> Seq Scan on tbl_punch (cost=0.00..2518.89 rows=336 width=4)
Filter: ((out_device IS NOT NULL) AND (user_id = 1001))