Rog Saber (12/20/2012)
I am a developer and not a DBA. My customers are complaining about how slow my application is running. My application has about 3 queries that are very similar. They contain unions and case statements. When I run a particular query in management studio, sometimes it takes about 10 seconds. So, with three queries you can see that it takes a while in the application.However, sometimes when I run the query in management studio, it comes back instantly or maybe takes a second or two. I know there are many factors involved in DB performance - lots of people hitting the DB at the same time, etc. I woud think that if there was a major problem with the query that it would always take a while to retrieve but that is not the case.
My question is if my queries actually do come back instantly, do I even spend any more time trying to tweak them or just write it off to a server, other issue and look elsewhere?
You've already answered that question. Performance as perceived by the customer is the only criteria you need to meet and you've already said that your customer is not happy with the performance. Yes, there are many factors that can affect the performance of the server but your customer doesn't care about that. I'd recommend revisiting your code or your customer might not be revisiting you in the future (unless you can actually PROVE that the server is at fault.) 😉
--Jeff Moden
Change is inevitable... Change for the better is not.