QUERY PLAN
Sort (cost=4113.38..4113.39 rows=2 width=36)
Sort Key: code
-> HashAggregate (cost=4113.31..4113.37 rows=2 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..4015.89 rows=38966 width=4)
Filter: (code IS NOT NULL)