QUERY PLAN
Sort (cost=535.29..535.29 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=535.25..535.28 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..522.80 rows=4978 width=4)
Filter: (code IS NOT NULL)