QUERY PLAN
Sort (cost=4047.59..4047.60 rows=2 width=36)
Sort Key: code
-> HashAggregate (cost=4047.52..4047.58 rows=2 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..3951.66 rows=38343 width=4)
Filter: (code IS NOT NULL)