I had serious problems with performance of my SQL query last week (I’m not familiar with SQL as I’d like to be). I needed to develop statatistic report and one part of its was very slow. I didn’t understand why. I spent one day to find cause of delay. Well, I’ve found the bottleneck! Problem was in data type cast.