QUERY PLAN
Sort (cost=2116.71..2116.71 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=2116.66..2116.70 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..2074.05 rows=17045 width=4)
Filter: (code IS NOT NULL)