QUERY PLAN
Sort (cost=5071.46..5071.46 rows=2 width=36)
Sort Key: code
-> HashAggregate (cost=5071.38..5071.45 rows=2 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..4952.39 rows=47596 width=4)
Filter: (code IS NOT NULL)