QUERY PLAN
Sort (cost=5551.39..5551.39 rows=2 width=36)
Sort Key: code
-> HashAggregate (cost=5551.31..5551.38 rows=2 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..5437.54 rows=45508 width=4)
Filter: (code IS NOT NULL)