Use single row mode of postgresql to speed up database queries
Instead of waiting (and blocking) for the whole result of a query, we could get them one by one, and act on them while postgresql is retrieving the rest of the results. It will probably not be significantly faster, though. Long queries are not really long because of the huge size of the result, but because of the size of the database it has to search in.
Anyway, this could be a neat improvement, and interesting to code.