QUERY PLAN
Sort (cost=1284.18..1284.19 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=1284.14..1284.17 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..1252.98 rows=12465 width=4)
Filter: (code IS NOT NULL)