You need to show us the code. You are probably not doing things in the most efficient way, e.g. using prepare_cached. There is also a way to adjust how many rows get fetched at once, "RowCacheSize", which can make a big difference on large queries. I don't think it will affect inserts at all though.