QUERY PLAN
Sort (cost=1142.38..1142.38 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=1142.33..1142.37 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..1114.73 rows=11041 width=4)
Filter: (code IS NOT NULL)