QUERY PLAN
Sort (cost=852.29..852.29 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=852.25..852.28 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..832.46 rows=7914 width=4)
Filter: (code IS NOT NULL)