I’ve a problem with database, and here is a scenario I’m dealing with every day: usually application can deal with traffic etc. but several times a day I’m dealing with performance issue. When it’s happening stored procedures increase their execution time from 200%-1000% .
I have one, described here: https://stackoverflow.com/questions/5585726/query-with-large-table-joins-optimization-techniques . Usually its execution takes about 6-8seconds (I’ve already optimized it from 20seconds cos at the beginning I thought the procedure is the culprit), but when something is happening, that procedure can execute even 60seconds.
And today I realized that there are more places in application that freeze, and what is more, I accidentaly realized that sample queries issued from SQL Management Studio, that usually execute in the blink of an eye, start to slow down when something happens with database server. Good news is, that thanks to this finding I eliminated both application & web servers as bottlenecks.
It’s database server that’s not able to handle requests. I wonder is there a way to troubleshoot live database and spot slow queries or other action like rebiulding indexes, statistics, memory problems etc. or perhaps other issues that could result in described performance decline?
Thanks, Pawel
This is a query that I use pretty much constantly.
It shows you currently executing code, Wait information, blocking information, what spids are running, how long they have been running, what the current command is, what the query text is, and the xml query plan if there is one in the cache: