Posts

Showing posts from May, 2015

Lies, damned lies, and statistics - a practical demonstration of how table statistics make or break performance

I recently discovered a process that I didn't recognise which had been running for nearly an hour.  With my current employer, the fact that it was a job I didn't recognise wasn't the bit that phased me (I've got used to that kind of thing happening here), but the fact that it had been running for so long was worrying. I checked with the dev team responsible for it, and they told me that it "ran in 15m in development", which is a vastly underpowered VM compared to the physical production server, so the fact that it had been running an hour was cause for concern. I checked the process was actually running and doing work, I checked that it wasn't blocking anything else, and that it looked like it would (probably, eventually) finish at some point. I checked the execution plan (ugh, it was nasty) and compared it to the one on the development server.  The two were completely different.  This prompted me to take a look at the table statistics, and there wer