QUERY PLAN
Sort (cost=3550.65..3550.65 rows=1 width=36)
Sort Key: code
-> HashAggregate (cost=3550.61..3550.64 rows=1 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..3477.22 rows=29354 width=4)
Filter: (code IS NOT NULL)