QUERY PLAN
Sort (cost=330.50..330.50 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=330.46..330.49 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..323.17 rows=2915 width=4)
Filter: (code IS NOT NULL)