I've looked at both locations again and found out, that the String instances holding the queries are created for each row found. So I've created a patch to reduce the number of String instances.