1 of 7
Jmaurier
  • 797
  • 2
  • 5
  • 19

What are some ways to speed up a stored procedure?

Here was an interview question that I just had (most likely did not get the job(fresh undergrad)). I would like to know what a good answer to this would be and what the different options could be.

We have a stored procedure that is taking 26 seconds to return information that is grabbed from 5 tables. Our server times out after 25 seconds. How can you solve this problem?

This is not verbatim but it is close to the question that was asked. I had no clue and I don't even think we went into that kind of detail in our db class. All I could think of telling them is to make sure that the tables are indexed and I don't even know if that is right!

Maybe I should have told her that I would have asked stackoverflow... because that's probably true.

What are my options for this question?

Jmaurier
  • 797
  • 2
  • 5
  • 19