Do not query the default timeout on each row
Use buffer when reasing from socket.

Do not call gen_tcp:recv/3 that often.
Improve the row data parsing
Avoid lists:reverse
Use decoder funs instead of matching on each row
Use binary_to_integer/1 is available
Set the gen_tcp recbuf size