Deoptimize amount of sql queries, many small ones are faster than one large