How is it possible that a cached query could take that long. With cache cleared it takes 25000 ms (I know that's just way too long but that's not the issue here). Once it is cached, it takes 2500 ms. What could be the problem here? If it's cached, I assume Sql Server gets it out of the RAM. So, again, 2500ms???
Because it may take so long?
Cached means the query plan is cached, not the results. If the cache is sub optimal, or you just have crappy indices or a lot of data - why not? ;) I have seen queries run for hours - after the plan was determined.
Now, you dinciate that is on a VM - may I just say that VM's NORMALLY totally suck for databases. Noting wrong with them in general, but when I plan a proper database server I spend time thinking about my disc layout. Most VM implementations I have seen - ignore that. Result: crappy IO. Resiult: SLOW PROCESSING.
Sorr, VM does not abstract away physical reality.
I would really look at the VM - allocated RAM, CPU, discs - and then go down to the physical level and see how the discs translate into pyhsical discs.