QUERY PLAN
Sort (cost=4839.53..4839.53 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=4839.48..4839.52 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..4741.13 rows=39341 width=4)
Filter: (code IS NOT NULL)