Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We had an issue in our dev environment where a procedure call timed out from the web server after 30 seconds. I traced the query and ran it manually (same params and all) from SSMS and it executed in about 2 seconds. I then ran

dbcc dropcleanbuffers
dbcc freeproccache

and after that the call from the web server also completed in time just fine.

I would suspect that the same plan should be used since I was using the exact same parameters from both connections, but I'm not sure.

My question is: Can there be different plans or buffers for different connections? Or could it have been some other side effect caused by me running the above dbcc-commands?

@MartinSmith: it's in the accepted answer in my last link
–
gbnDec 29 '11 at 12:55

Thanks for the links. Different credentials were used so that could be a reason then. But I'm not sure what you specifically meant by timing? In any way I guess this problem was more likely to be caused by different plans being used than something with the buffers, i.e. dbcc dropcleanbuffers probably didn't have any effect by itself?
–
Andreas ÅgrenDec 29 '11 at 14:10

@Andreas:by timing, I mean a lag between web timeout and running in SSMS (eg lunch or such) which means the plan was invalid or purged. So the SSMS plan wasn't the same cached and compiled one from the web server. DBCC would clear the cache, but you did that after running in SSMS.
–
gbnDec 29 '11 at 14:16