QUERY PLAN
Sort (cost=5052.21..5052.21 rows=2 width=36)
Sort Key: code
-> HashAggregate (cost=5052.13..5052.20 rows=2 width=36)
Group Key: code
-> Seq Scan on tbl_api_log a (cost=0.00..4933.59 rows=47416 width=4)
Filter: (code IS NOT NULL)