QUERY PLAN
Aggregate (cost=528.74..528.75 rows=1 width=8)
-> Seq Scan on tbl_api_log a (cost=0.00..519.69 rows=3620 width=0)
Filter: (device_type = '2'::smallint)