QUERY PLAN
Sort (cost=329.37..329.38 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=329.33..329.36 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..322.07 rows=2905 width=4)
Filter: (code IS NOT NULL)