rewrote SQL generation
included speedy2csv